Question: How to reshape a fasta file?
0
gravatar for gbl1
12 months ago by
gbl170
gbl170 wrote:

Hello,

I've got some sequences shaped as

>Sj-D-P_M0276n4:119:000000000-C5R9K:1:1106n:1548n9:8n8n42 1:N:0:7
CTCAGAGCCAGGGTGCCACAGGTAAGAGTTACCTAAACTCAACATCCACGCTCTTTTTTGACCGCATGTC
TGAAACTTGAAGGAATTCCACCATTGCTTGTAGTCATCCTGAGTCAAATTTGCAGTTGTCTCACCACATG
TATGACCACCAGAGCCCTGGCCCTTCTCCATGTCCCGTGCATACCGCACGCCTCGCCGCTATTACCGTGC
CGAGCCACCGCTGTCCCGATCGAGTCTCAAGGGCCGCAAACCCACACCACTCAACCCCTGCTGCAAGGTG
AGGACCCGCAACTCGCTGT

I would like to remove the back to lines in the sequences (but not in the names) like:

>Sj-D-P_M0276n4:119:000000000-C5R9K:1:1106n:1548n9:8n8n42 1:N:0:7    
CTCAGAGCCAGGGTGCCACAGGTAAGAGTTACCTAAACTCAACATCCACGCTCTTTTTTGACCGCATGTCTGAAACTTGAAGGAATTCCACCATTGCTTGTAGTCATCCTGAGTCAAATTTGCAGTTGTCTCACCACATGTATGACCACCAGAGCCCTGGCCCTTCTCCATGTCCCGTGCATACCGCACGCCTCGCCGCTATTACCGTGCCGAGCCACCGCTGTCCCGATCGAGTCTCAAGGGCCGCAAACCCACACCACTCAACCCCTGCTGCAAGGTGAGGACCCGCAACTCGCTGT

How to proceed?

Thanks in advance

dna fasta • 376 views
ADD COMMENTlink modified 12 months ago by JC10k • written 12 months ago by gbl170
1

have you looked around for a (possible) solution? This has been covered several times before. try googling on something like "reformat fasta file to single line", that will give you numerous options.

one of the results will be Multiline Fasta To Single Line Fasta for instance.

ADD REPLYlink written 12 months ago by lieven.sterck8.0k

The keyword you’re looking for here is likely “linearising fasta”

ADD REPLYlink written 12 months ago by Joe17k

Thanks :)

I had looked for "reshape fasta" nothing out… Well, a non-native issue

ADD REPLYlink written 12 months ago by gbl170

This is the thread you were looking for: A: Multiline Fasta To Single Line Fasta

ADD REPLYlink written 12 months ago by genomax85k
1
gravatar for JC
12 months ago by
JC10k
Mexico
JC10k wrote:

perl -pe 's/\n// unless (/>/)' < FASTA > LINEARFASTA

ADD COMMENTlink written 12 months ago by JC10k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2008 users visited in the last hour