CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Find a pattern and write the following letters to file

 



francy87
Novice

Sep 10, 2013, 5:32 PM

Post #1 of 2 (503 views)
Find a pattern and write the following letters to file Can't Post

Hello! I'm pretty new in script and shell stuffs...
I need to find a pattern in a file of DNA sequences and write the following sequence in an output file. I try to explain better... I have a file like this:
> sample-name seq-length tgattggccgattggaatcg (and so on)
> sample-name seq-length tgaggttccgtaggtccatc (and so on)
I want to find a specific sequence of 10 nucleotide and write all the sequence that follow it in another file. If that specific sequence isn't find, it hasn't to write anything. Moreover, I need to mantain the sequence header with the name of the sample, etc since I'll need it for the following analysis...
Anyone can help me to do this???

Thanks
Francesca


BillKSmith
Veteran

Sep 10, 2013, 6:37 PM

Post #2 of 2 (500 views)
Re: [francy87] Find a pattern and write the following letters to file [In reply to] Can't Post

Am I correct that for each line of your file, you want to remove all the dna characters before and including some fixed string?


Code
$line =~ /^[acgt]+$FixedString//;

Good Luck,
Bill

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives