Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Phlya
    Junior Member
    • May 2014
    • 3

    #1

    bedtools intersect - problem with chromosomes with number >=10?

    Hi!

    I have an alignment (.bam) of reads to mm9 genome. I sorted it with samtools sort, so that later I can use -sorted key with bedtools. I also created a .bed-file with regions of interest, in which I want to count number of reads, that mapped to them, and sorted it with command-line sort. I tried this: converted .bam to .bed with bedtools bamtobed and then intersected them counting number of reads:
    Code:
    bedtools intersect -a regions_of_interest.bed -b alignment_sorted.bed -c -sorted  > Neg2H_counts.bedgraph
    The problem is, it looks fine for all chromosomes with numbers from 0 to 9 (and X), but all counts for all regions of interest of chromosomes with higher number (chr10, chr11, etc) are 0. There is no biological reason for that, in fact the highest signal should be on chr11. What could be wrong here? I am fairly new to all these tools.

    UPDATE
    I tried to do the same intersection with bedmap and the result is identical... So there probably is something wrong with my files - what could it be?
    I also tried sorting the alignment-derived bed-file in the same way, as I did with the files with regions of interest and it doesn't help.
    Last edited by Phlya; 06-01-2014, 02:43 AM.
  • blancha
    Senior Member
    • May 2013
    • 367

    #2
    It could be that the sorting order is not correct in one, or both of the files.
    You could just check the chromosomal order in both your BED files.
    You could also try the following sort command on both BED files.

    Code:
    sort -k1,1 -k2,2n regions_of_interest.bed > regions_of_interest_sorted2.bed
    sort -k1,1 -k2,2n alignment_sorted.bed > alignment_sorted2.bed
    bedtools intersect -a regions_of_interest_sorted2.bed -b alignment_sorted2.bed -c -sorted  > Neg2H_counts_sorted2.bedgraph

    Comment

    • Phlya
      Junior Member
      • May 2014
      • 3

      #3
      Thank you! It seems that it doesn't expect the file to be sorted as chr1, chr2, chr3, but rather as chr1, chr10, chr11, etc. I was sorting them to get the first, logical order, but after sorting as you suggested it worked!

      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
        ...
        Yesterday, 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, Yesterday, 02:55 AM
      0 responses
      9 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-24-2026, 12:17 PM
      0 responses
      12 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-23-2026, 11:41 AM
      0 responses
      12 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-20-2026, 11:10 AM
      0 responses
      24 views
      0 reactions
      Last Post SEQadmin2  
      Working...