This is a test version of Biostars. For the public version, visit https://www.biostars.org.
extract one specie, fasta file sequences

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

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

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

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.

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

Thanks again,

Adriana

0 answers

No answers yet.

Log in to answer this question.