extract one specie, fasta file sequences
0
0
Entering edit mode
7.8 years ago
mgadrianam ▴ 30

Hi

I have a file with microRNAs sequences of different species and I want a file with only human microRNAs

">hsa-miR-130b-3p MIMAT0000691 Homo sapiens miR-130b-3p"

CAGUGCAAUGAUGAAAGGGCAU

">hsa-miR-30e-5p MIMAT0000692 Homo sapiens miR-30e-5p"

UGUAAACAUCCUUGACUGGAAG

">hsa-miR-30e-3p MIMAT0000693 Homo sapiens miR-30e-3p"

CUUUCAGUCGGAUGUUUACAGC

">hsa-miR-26a-2-3p MIMAT0004681 Homo sapiens miR-26a-2-3p"

CCUAUUCUUGAUUACUUGUUUC
">cbr-miR-72 MIMAT0000694 Caenorhabditis briggsae miR-72"

AGGCAGAUGUUGGCAUAGC

">cel-miR-354-5p MIMAT0031894 Caenorhabditis elegans miR-354-5p"

GGUGCGGCUGCAGACGGGUAU

">cel-miR-354-3p MIMAT0000696 Caenorhabditis elegans miR-354-3p"

ACCUUGUUUGUUGCUGCUCCU

">cel-miR-355-5p MIMAT0000697 Caenorhabditis elegans miR-355-5p"

UUUGUUUUAGCCUGAGCUAUG

I use this comand: grep "^>hsa" mature.fa > mature_hsa.fa

but I only had the first line

">hsa-let-7a-5p MIMAT0000062 Homo sapiens let-7a-5p"

">hsa-let-7a-3p MIMAT0004481 Homo sapiens let-7a-3p"

">hsa-let-7a-2-3p MIMAT0010195 Homo sapiens let-7a-2-3p"

">hsa-let-7b-5p MIMAT0000063 Homo sapiens let-7b-5p"

">hsa-let-7b-3p MIMAT0004482 Homo sapiens let-7b-3p"

">hsa-let-7c-5p MIMAT0000064 Homo sapiens let-7c-5p"

">hsa-let-7c-3p MIMAT0026472 Homo sapiens let-7c-3p"

">hsa-let-7d-5p MIMAT0000065 Homo sapiens let-7d-5p"

">hsa-let-7d-3p MIMAT0004484 Homo sapiens let-7d-3p"

">hsa-let-7e-5p MIMAT0000066 Homo sapiens let-7e-5p"

How I can have the sequence also.

Thanks very much

sequence fasta • 3.0k views
ADD COMMENT
1
Entering edit mode

please search this site for "Filtering fasta". It has already been answered a gazillion times.

ADD REPLY
1
Entering edit mode

You are looking for

grep -A 1 --no-group-separator "^>hsa" mature.fa > mature_hsa.fa

Look at man grep to see options it can take.

ADD REPLY
0
Entering edit mode

Thanks you very much!! it works, I tried before with -A (--after-context) but I did not add the number

Thanks again,

Adriana

ADD REPLY
0
Entering edit mode

there seams to be something wrong with the "line end" marker in your example. Maybe you have used Microsoft word as text editor.

ADD REPLY

Login before adding your answer.

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