Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ykdang
    Junior Member
    • Oct 2011
    • 7

    #1

    How to generate GFF?

    I am working on a fungus call Neurosprora. Previous lab member built a gbrowser (1.70) to visualize the deep-seq data with GFF2 file format. Now I obtain some new deep-seq data and want to load it onto that browser. I heard that he used bowtie to do alignment and convert into gff2, but I cannot find the script to convert. Does anyone have similar script which could share? Or just indicate any tools can do this trick? I am not a perl person and don't think I could learn it in a short while.
  • gringer
    David Eccles (gringer)
    • May 2011
    • 845

    #2
    If you have a BAM file (which bowtie can produce), this tutorial suggests that GBrowse can handle BAM directly:



    You could also have a look at the admin tutorial:

    Comment

    • gringer
      David Eccles (gringer)
      • May 2011
      • 845

      #3
      FWIW, I've just today ended up writing a python script to convert from SAM/BAM files to GFF3 files using pysam. The code may be useful for you if you can't find anything else suitable for your conversion.

      For a bit of context, I broke up genomic contigs into 100bp fragments, naming the sequences <contig>#<start>-<end>, then used bowtie2 to map them to the genome -- that's why I've got the 'read.qname.find' bits in the code. My contigs started with 'v', which bowtie replaced with 'N' for some odd reason, so I had to do a bit of extra fiddling to add the 'v' back in.

      Here's the relevant part of my code which does the SAM->GFF conversion:
      Code:
      samFile = pysam.Samfile(samFileName, "r")
      totalCount = 0
      sys.stderr.write("Getting reads from SAM file...")
      sys.stdout.write("##gff-version 3\n")
      gffWriter = csv.writer(sys.stdout, delimiter = '\t')
      for read in samFile:
          totalCount += 1
          if(read.tid > 0):
              qContig = 'v' + read.qname[1:read.qname.find("#")]
              qContigStart = read.qname[read.qname.find("#")+1:read.qname.find("-")]
              qContigEnd = read.qname[read.qname.find("-")+1:]
              tContig = samFile.getrname(read.tid)
              strand = "-" if read.is_reverse else "+"
              score = "."
              for tag in read.tags:
                  if(tag[0] == "XS"):
                      score = str(tag[1]+1000)
              gffWriter.writerow((qContig,
                                  "sam2gff3-"+os.path.basename(samFileName),
                                  "nucleotide_match", qContigStart, qContigEnd,
                                  score, strand, ".",
                                  "Name=SAM_%s,ID=%s-%s;Target=%s %d %d" %
                                  (tContig, qContig, tContig, tContig,
                                   read.pos, read.aend)))
          if(totalCount % 100000 == 0):
              sys.stderr.write(".")
      Last edited by gringer; 11-02-2011, 12:17 PM. Reason: fixed up GFF3 parsing errors, added Name attribute to avoid contig clashes

      Comment

      • ykdang
        Junior Member
        • Oct 2011
        • 7

        #4
        Thanks a lot, that's could be very useful

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
          by SEQadmin2



          CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

          Despite this, “CRISPR helped turn genome editing from a specialized technique into
          ...
          07-31-2026, 11:01 AM
        • SEQadmin2
          Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
          by SEQadmin2


          Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

          The systematic characterization of the human proteome has
          ...
          07-20-2026, 11:48 AM
        • SEQadmin2
          Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
          by SEQadmin2



          Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
          ...
          07-09-2026, 11:10 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, 08-03-2026, 10:13 AM
        0 responses
        21 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-31-2026, 02:55 AM
        0 responses
        34 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-24-2026, 12:17 PM
        0 responses
        25 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-23-2026, 11:41 AM
        0 responses
        21 views
        0 reactions
        Last Post SEQadmin2  
        Working...