Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Palgrave
    Member
    • Aug 2011
    • 73

    #1

    Get loop sequence from miRBase

    Does anyone know a way to extract the loop sequence from the miRNA hairpin. Basically I need to extract the part that is between the 3p- and 5p part of the hairpin.
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    Just align the 5p and 3p sequences to the hairpin sequence and take the bit between them.

    Comment

    • Palgrave
      Member
      • Aug 2011
      • 73

      #3
      Originally posted by dpryan View Post
      Just align the 5p and 3p sequences to the hairpin sequence and take the bit between them.
      I have tried, but struggle to find a command that works.

      Comment

      • dpryan
        Devon Ryan
        • Jul 2011
        • 3478

        #4
        I would expect that either biopython or bioperl should make this relatively straight forward. The idea is to either use base python string matching or the pairwise2 module and global alignment.

        Comment

        • peterawe
          Member
          • Mar 2013
          • 14

          #5
          Here is another suggestion using R/Bioconductor. Good luck!

          Code:
          require(rtracklayer)
          require(BSgenome.Hsapiens.UCSC.hg19)
          require(ShortRead)
          
          mirTrack = import('ftp://mirbase.org/pub/mirbase/20/genomes/hsa.gff3')
          
          # split into hairpin, 5arm and 3arm
          hp = mirTrack[mirTrack$type != "miRNA"]
          arm5 = mirTrack[grepl("-5p", mirTrack$Name)]
          arm3 = mirTrack[grepl("-3p", mirTrack$Name)]
          
          # make key for matching hairpin with arm5 and arm3
          hp$arm5 = match(hp$ID, arm5$Derives_from)
          hp$arm3 = match(hp$ID, arm3$Derives_from)
          
          # discard hairpins lacking annotated 5p and 3p arms (loops not defined)
          hp = hp[!is.na(hp$arm3) & !is.na(hp$arm5)]
          
          # prepare 
          hp$loopStart = 0
          hp$loopEnd = 0
          
          # miRNAs on pos and neg strand have to be parsed separately
          ## posStrand
          isPos = as.vector(strand(hp) =="+")
          hp$loopStart[isPos] = end(arm5[hp$arm5[isPos]])
          hp$loopEnd[isPos] = start(arm3[hp$arm3[isPos]])
          
          ## negStrand
          hp$loopEnd[!isPos] = start(arm5[hp$arm5[!isPos]])
          hp$loopStart[!isPos] = end(arm3[hp$arm3[!isPos]])
          
          # GRanges for miRNA loops
          loops = GRanges(seqnames = seqnames(hp), 
            IRanges(hp$loopStart, hp$loopEnd),strand = strand(hp), 
            MI = hp$ID, Name = hp$Name)
          
          # sanity check
          hist(width(loops))
          
          # we don't want the first/last nt of bounding mature miRs
          loops = loops-1
          loops$seq = getSeq(Hsapiens, loops) 
          loops
          
          # export as fastaFile
          loopsFasta = loops$seq
          names(loopsFasta) = paste("loopSeq", loops$MI, loops$Name, sep = "_")
          writeFasta(loopsFasta, file = "mirbase20loops.fa")

          Comment

          • peterawe
            Member
            • Mar 2013
            • 14

            #6
            Hi! Here is a suggestion using R/Bioconductor. Good luck

            Code:
            require(rtracklayer)
            require(BSgenome.Hsapiens.UCSC.hg19)
            require(ShortRead)
            mirTrack = import('ftp://mirbase.org/pub/mirbase/20/genomes/hsa.gff3')
            
            # split into hairpin, 5arm and 3arm
            hp = mirTrack[mirTrack$type != "miRNA"]
            arm5 = mirTrack[grepl("-5p", mirTrack$Name)]
            arm3 = mirTrack[grepl("-3p", mirTrack$Name)]
            
            # make key for matching hairpin with arm5 and arm3
            hp$arm5 = match(hp$ID, arm5$Derives_from)
            hp$arm3 = match(hp$ID, arm3$Derives_from)
            
            # discard hairpins without annotated 5p and 3p arms
            hp = hp[!is.na(hp$arm3) & !is.na(hp$arm5)]
            
            # prepare
            hp$loopStart = 0
            hp$loopEnd = 0
            
            # miRNAs on pos and neg strand have to be parsed separately
            ## posStrand
            isPos = as.vector(strand(hp) =="+")
            hp$loopStart[isPos] = end(arm5[hp$arm5[isPos]])
            hp$loopEnd[isPos] = start(arm3[hp$arm3[isPos]])
            ## negStrand
            hp$loopEnd[!isPos] = start(arm5[hp$arm5[!isPos]])
            hp$loopStart[!isPos] = end(arm3[hp$arm3[!isPos]])
            # GRanges for miRNA loops
            loops = GRanges(seqnames = seqnames(hp),
            IRanges(hp$loopStart, hp$loopEnd),strand = strand(hp),
            MI = hp$ID, Name = hp$Name)
            # sanity check
            hist(width(loops), breaks = 50)
            # we dont want th efirst/last nt of bounding mature miRs
            loops = loops-1
            loops$seq = getSeq(Hsapiens, loops)
            # export
            loops
            loopsFasta = loops$seq
            names(loopsFasta) = paste("loop", loops$MI, loops$Name, sep = "_")
            writeFasta(loopsFasta, file = "mirbase20loops.fa")
            readLines("mirbase20loops.fa")

            Comment

            Latest Articles

            Collapse

            • SEQadmin2
              New Genomics Technologies Take Aim at Long-Standing Limits
              by SEQadmin2


              Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

              We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
              ...
              09-28-2026, 10:25 AM
            • SEQadmin2
              How Immunogenomics Decodes Immunity’s Genetic Blueprint
              by SEQadmin2




              The immune system’s power comes from its genetic diversity, allowing myriad threats to be neutralized through first recognizing foreign antigens. That diversity is also what makes the immune system so difficult to study. Recent advances in sequencing technology and computational biology, however, are giving researchers new tools to understand immune responses and immune-related diseases in greater detail.

              This convergence of genetics, immunology, and computation...
              09-01-2026, 05:41 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, Yesterday, 09:51 AM
            0 responses
            11 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 09-25-2026, 09:06 AM
            0 responses
            34 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 09-23-2026, 11:05 AM
            0 responses
            28 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 09-18-2026, 11:37 AM
            1 response
            48 views
            0 reactions
            Last Post pekgio
            by pekgio
             
            Working...