Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mapping annotation to genome positions

    Hi all,

    I am looking for a faster method to map annotation I obtained from RAST to a range of target genome positions.

    The method I am currently using is by filtering the start and end position in the excel file to my target range (for example if I am finding annotated CDS that locates between 49050 and 54500 bp, I filter the genome location of the annotation file to "larger or equal to 49050" and "less than or equal to 54500" and copy the related result from there.

    This method is extremely time-consuming and now I have a set of data with about 500 ranges so I am looking for suggestions on any method that I can use to speed up this process? I know very limited awk and R but is familiar with usage of Linux OS.

    Thank you in advance for any help

  • #2
    Hi,
    the easiest (and fastest) would be to go either using the packages Rsamtools (including GRanges) and rtracklayer on R, or bedtools...

    Comment


    • #3
      Although I agree with SylvainL that R should be faster than awk in this case you should not underestimate the power of linux tools for tasks like this. A simple script using awk how this could look like is the following (it expects bed format in its current version):

      #!/bin/sh

      #example call: thisScriptName.sh coordinatesFile dataFile outputFile

      #$1 (coordinatesFile) to be the file with your coordinates you want to select for
      #$2 (dataFile) to contain your data
      #$3 (outputFile) is the file you want to save your results to

      IFS='
      ' #use line break as end of line separator
      #loop through lines of your coordinatesFile and for each line look in your data file
      for line in $(cat $1)
      do
      lowLimit=$(echo $line | awk -F'\t' '{print $2}')
      highLimit=$(echo $line | awk -F'\t' '{print $3}')
      awk '{OFS="\t"; if(($2>'$lowLimit' && $2<'$highLimit') || ($3>'$lowLimit' && $3<'$highLimit')) print $0}' $2 >> $3
      done

      Comment


      • #4
        BEDOPS offers bedmap, for mapping features from one BED file to another. It is fast and efficient, and supported on Linux. Operations are offered that work with numerical and categorical features.

        More information is available here:



        Be careful when converting Excel output to BED, in that Microsoft adds special endline characters that interfere with the functionality of bedmap and other Unix tools. The "dos2unix" application is useful here for cleaning Excel-sourced text files:

        Comment

        Latest Articles

        Collapse

        • seqadmin
          Essential Discoveries and Tools in Epitranscriptomics
          by seqadmin




          The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
          04-22-2024, 07:01 AM
        • seqadmin
          Current Approaches to Protein Sequencing
          by seqadmin


          Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
          04-04-2024, 04:25 PM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, 04-11-2024, 12:08 PM
        0 responses
        59 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 10:19 PM
        0 responses
        57 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 09:21 AM
        0 responses
        51 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-04-2024, 09:00 AM
        0 responses
        55 views
        0 likes
        Last Post seqadmin  
        Working...
        X