how to seperate gene info
1
0
Entering edit mode
4.0 years ago
tommy ▴ 40

Hello, When I am trying to do samtools on each of sequence, I met the problem of seperating them. I have file gene.info which contain contents:

ENA|MBYW01000151|MBYW01000151.1 34978   35427
ENA|MBYW01000151|MBYW01000151.1 36152   36476

what I want to have is them separate,

file1 with content ENA|MBYW01000151|MBYW01000151.1 34978 35427

file2 with contnet ENA|MBYW01000151|MBYW01000151.1 36152 36476

I thought it will be easy to achieve with cut command, but

 cat geneinfo.txt | cut -f 1
 ENA|MBYW01000151|MBYW01000151.1
 ENA|MBYW01000151|MBYW01000151.1

 cat geneinfo.txt | cut -f 2
 34978
 36152

 cat geneinfo.txt | cut -f 3
 35427
 36476

which is really wield, I don't know why?

Thanks for your helping.

for more information, geneinfo.txt is obtained by run

blastn -query S288C_YLL052C_AQY2_genomic.fsa -db beer001.fa -outfmt "6 sseqid send sstart" >> geneinfo.txt
sequencing • 940 views
ADD COMMENT
0
Entering edit mode

head -n 1 gene.info > file1

head -n 2 gene.info > file2

ADD REPLY
0
Entering edit mode

I am trying to do samtools on each of sequence

What does that mean?

ADD REPLY
0
Entering edit mode

samtool is a tool to clip certain regions of genes.

ADD REPLY
1
Entering edit mode
4.0 years ago

cut cuts by column, not by line. If you want each line in single files, then you should go for something like this:

awk '{print > "file"NR}' geneinfo.txt

being NR the row number.

ADD COMMENT
0
Entering edit mode

Thanks for your help.

ADD REPLY

Login before adding your answer.

Traffic: 2249 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