How to reshape a fasta file?
1
0
Entering edit mode
5.4 years ago
gbl1 ▴ 80

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

fasta DNA • 1.2k views
ADD COMMENT
1
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Thanks :)

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode
5.4 years ago
JC 13k

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

ADD COMMENT

Login before adding your answer.

Traffic: 2388 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6