Question: How to reshape a fasta file?
0
gravatar for gbl1
9 weeks 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 • 217 views
ADD COMMENTlink modified 9 weeks ago by JC8.2k • written 9 weeks 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 9 weeks ago by lieven.sterck5.6k

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

ADD REPLYlink written 9 weeks ago by jrj.healey13k

Thanks :)

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

ADD REPLYlink written 9 weeks ago by gbl170

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

ADD REPLYlink written 9 weeks ago by genomax70k
1
gravatar for JC
9 weeks ago by
JC8.2k
Mexico
JC8.2k wrote:

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

ADD COMMENTlink written 9 weeks ago by JC8.2k
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: 505 users visited in the last hour