1
$\begingroup$

I believe many of the experts here have gone through this issue,

I have run tRNAscan-SE on my genome to predict all the tRNAs, and have successfully gotten all the tRNA coordinates like start, end and type all arranged in a table.

My question is how can I convert this result to fasta format as long I have all the details about the tRNA ready?

Is there any tool that I can use to get the fasta sequences of the regions described in my table from the original genome?


enter image description here

Sequence                tRNA    Bounds  tRNA    Anti    Intron Bounds   Inf       
Name            tRNA #  Begin   End     Type    Codon   Begin   End     Score   Note
--------        ------  -----   ------  ----    -----   -----   ----    ------  ------
NW_011590950.1  1       36704   36632   Ala     AGC     0       0       40.8    pseudo
$\endgroup$
10
  • $\begingroup$ Could you provide the table you are referring? Having some sample data will help us to answer your questions. Do you have the reference genome? Many thanks! BTW, what have you tried? Perhaps manually finding the sequence or something else? $\endgroup$
    – llrs
    Oct 10 '18 at 10:06
  • $\begingroup$ I have uploaded the table, unfortunately, the data I'm working on doesn't have a reference. $\endgroup$
    – BioInfo
    Oct 10 '18 at 10:33
  • $\begingroup$ finding these results just by running tRNAscan on my genome, the table above is my Results, in fact, I need a fasta format has all the tRNA sequence to implemented in another tool $\endgroup$
    – BioInfo
    Oct 10 '18 at 10:35
  • 2
    $\begingroup$ You provided a picture, could you provide text that could be used to copy and paste to make it easier for people to use the information? $\endgroup$
    – llrs
    Oct 10 '18 at 11:05
  • $\begingroup$ I did upload a copy from the data but, when past here doesn't arrange accordingly $\endgroup$
    – BioInfo
    Oct 11 '18 at 6:22
3
$\begingroup$

You can select “Output BED format” on the tRNAscan-SE server:

screenshot

Given the output BED format and your input reference in FASTA format, you can easily generate a FASTA file of tRNA sequences via bedtools getfasta:

bedtools getfasta -name -s -fo ‹output.fasta› -fi ‹reference.fasta› -bed ‹tRNAscan-SE-output.bed›
$\endgroup$
1
  • $\begingroup$ thank you for the respond, but I'm running it locally, and the output options are Secondary, statistics, and shown table. but currently, I have submitted the job to their server, let's wait and see :) $\endgroup$
    – BioInfo
    Oct 14 '18 at 6:48
1
$\begingroup$

You can do this using the tools from the exonerate package. I assume you have all the sequences shown in your table in a single, multifasta file. If so, first create a single file per sequence using fastaexplode:

fastaexplode reference.fa

This will create one file for each sequence in reference.fa. Now, you can read through the results table, and extract the sequences:

tmpFile=$(mktemp)
awk -F"\t" '{ 
                if(NR>3){ printf "%s %s ", $1, $2; 
                    if($4>$3){
                        print $3, $4-$3
                    }
                    else{
                        print $4,$3-$4,"-"
                    }
                }
            }' file | while read name num start len rev; do 
                fastasubseq "$name".fa $start $len > $num.fa
                if [[ ! -z $rev ]]; then 
                    fastarevcomp $num.fa > $tmpFile && 
                    mv $tmpFile $num.fa
                fi
                done

I would suggest you go with Konrad's approach, however, that looks much cleaner and simpler.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.