SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics
Similar Threads
Thread Thread Starter Forum Replies Last Post
DGE - filter or not filter masterpiece Bioinformatics 0 07-11-2011 08:55 PM
Our new HiSeq, 1st impressions... james hadfield Illumina/Solexa 20 02-22-2011 05:48 AM
1st Galaxy Developer Conference | CSHL nekrut Events / Conferences 0 01-19-2010 06:02 AM
1st Cycle Int (PF) wouter Illumina/Solexa 8 10-06-2009 11:22 PM
1st cycle report bioinfosm Illumina/Solexa 11 10-10-2008 06:13 AM

Reply
 
Thread Tools
Old 08-18-2011, 07:53 AM   #1
cascoamarillo
Senior Member
 
Location: MA

Join Date: Oct 2010
Posts: 160
Default How to filter seqs by their 1st nt

Hi,

It sounds silly, but I couldn't find an approach for filter/separate sequences (in a fasta file) according to their first (or specific motif) nucleotide; I mean, to generate a file of seqs that starts all of them with the same nucleotide (A, T, G or C). Any ideas?

regards
cascoamarillo is offline   Reply With Quote
Old 08-18-2011, 11:42 PM   #2
NicoBxl
not just another member
 
Location: Belgium

Join Date: Aug 2010
Posts: 264
Default

simple with cat and grep :

here's the code to filter only the sequences that start with an A. For the other nt, juste change the A into T,G or C. The only thing, it's that each sequence must be written in one line. Fasta Width from galaxy do that (http://main.g2.bx.psu.edu/) Fasta Manipulation > Fasta Width.

Quote:
cat input.fasta | grep ^A -B 1 | grep '\-\-' -v > output.fasta

Last edited by NicoBxl; 08-18-2011 at 11:45 PM.
NicoBxl is offline   Reply With Quote
Old 08-19-2011, 06:40 AM   #3
cascoamarillo
Senior Member
 
Location: MA

Join Date: Oct 2010
Posts: 160
Default

Thanks mate!

It works fine.
cascoamarillo is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -8. The time now is 06:43 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO