Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-27-2012
Registered User
 
Join Date: Jun 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
How to change sequence name in along fasta file?

Hi
I have an alignment file (.fasta) with ~80 sequences. They look like this-

>JV101.contig00066(+):25302-42404|sequence_index=0|block_index=4|species=JV101|JV101_4_0

GAGGTTAATTATCGATAACGTTTAATTAAAGTGTTTAGGTGTCATAATTT
TAAATGACGATTTCTCATTACCATACACCTAAATTATCATCAATCTGAAT
TCAGATGTTTATTATAAAAATTAGATGAAAAATATGTTAATATACAAGTA

>JV501.contig00066(+):24356-42404|sequence_index=0|block_index=4|species=JV501|JV501_4_0
AATGACGATTTAGATGAAAAATAT...

The name of the sequences are too big and I want to just keep JV101, JV501 and delete rest of the words after the dot. I am new to unix, please suggest an easy unix command to do this.

Thanks

Baika
Sponsored Links
    #2  
Old 06-27-2012
bartus11's Avatar
Registered User
 
Join Date: Apr 2009
Posts: 3,145
Thanks: 3
Thanked 957 Times in 936 Posts
Try:
Code:
perl -pe 's/^>[^.]+\K.*//' file

Sponsored Links
    #3  
Old 06-27-2012
Registered User
 
Join Date: Jun 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks

Thank you very much for such a prompt reply. It is working!
Sponsored Links
Closed Thread

Tags
fasta, unix commands

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Parsing a fasta sequence with start and end coordinates empyrean Shell Programming and Scripting 8 04-15-2011 02:23 AM
How to change strt-up sequence of services on SLES10/11 senrooy Shell Programming and Scripting 3 03-03-2010 03:02 AM
How to change strt-up sequence of services on SLES10/11 senrooy Shell Programming and Scripting 4 03-02-2010 03:38 AM
change the shutdown sequence in red hat linux chuikingman Red Hat 5 01-30-2010 03:13 PM
how to change the boot sequence? wrapster Solaris 5 02-17-2008 03:10 AM



All times are GMT -4. The time now is 08:06 PM.