Sliding Window : discriminate partial and fully contained fragments (from a bam file)
1
0
Entering edit mode
7.2 years ago
w.elmselmi • 0

Hello everyone,

After Next Gen Sequencing, alignment (BWA), sorting and indexing (samtools), I obtained a bam file. I would like to know there is any tool allowing me to , when using a sliding windows on a bam file, discriminate fragments fully spanning the window from the other ones ?

For instance : To calculate a score for a given window, i would add +1 for each fragment completely spanning the window and -1 for the fragments having an endpoint in the window. Any Suggestions please ?

Thanks in advance.

next-gen sequencing sequence • 1.9k views
ADD COMMENT
0
Entering edit mode

what's the final aim of such tool ?

ADD REPLY
0
Entering edit mode

The aim is to infer nucleosomes locations

ADD REPLY
1
Entering edit mode
7.2 years ago

I've quickly written the following tool: https://github.com/lindenb/jvarkit/wiki/Biostar234230

Not fully checked/tested.

See the code for more information about the reads that are included/discarded.

$ curl -s "ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/technical/working/20110915_CEUtrio_b37_decoy_alignment/CEUTrio.HiSeq.WGS.b37_decoy.NA12892.clean.dedup.recal.bam" |  java -jar dist/biostar234230.jar 
#contig start   end pairs_in_window pairs_over_window   pairs_partial_overlap
1   10000   10100   0   2   240
1   10050   10150   4   615 274
1   10100   10200   0   800 276
1   10150   10250   0   216 649
1   10200   10300   0   2982    809
1   10250   10350   0   2918    207
1   10300   10400   0   1923    2851
1   10350   10450   0   227 4498
1   10400   10500   0   31  1971
(...)
ADD COMMENT
0
Entering edit mode

Thank you Pierre !

Could you explain me how your script manages paired end reads ?

ADD REPLY
0
Entering edit mode

it ignores the following reads:

  • unmapped
  • secondary
  • supplementary
  • not paired
  • not properly paired
ADD REPLY
0
Entering edit mode

Ok Thanks. I'll try to make a python version, i'll keep you informed.

ADD REPLY

Login before adding your answer.

Traffic: 2047 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6