kundajelab / chrombpnet

Bias factorized, base-resolution deep learning models of chromatin accessibility (chromBPNet)
https://github.com/kundajelab/chrombpnet/wiki
MIT License
124 stars 34 forks source link

Error while shifting ATAC reads; similar to issue #153 #169

Closed viramalingam closed 10 months ago

viramalingam commented 11 months ago

Hi all, I am also getting an error with shifting the reads similar to issue #153 . Alignment was done using chromap with no shift.

Thanks, Vivek

chrombpnet bias pipeline \
>         -itag /mnt/lab_data2/vir/random/chrombpnet_rando_org/acoel/hf_6h_post_rep1/SCFE01_ref/chrombpnet/data/aln_noshift.bed\
>         -d "ATAC" \
>         -g /mnt/lab_data2/vir/random/chrombpnet_rando_org/references/SCFE01/SCFE01.fsa_nt \
>         -c /mnt/lab_data2/vir/random/chrombpnet_rando_org/references/SCFE01/chroms.sizes \
>         -p chrombpnet/data/peaks_chromap_fragments_MACS_q01_peaks.narrowPeak\
>         -n chrombpnet/data/output_auxillary/negatives.bed \
>         -fl /mnt/lab_data2/vir/random/chrombpnet_rando_org/references/SCFE01/fold_0.json \
>         -b 0.5 \
>         -o chrombpnet/bias_model/ \
>         -fp hf_6h_post_rep1
Estimating enzyme shift in input file
Traceback (most recent call last):
  File "/users/vir/anaconda3/envs/chrombpnet/bin/chrombpnet", line 8, in <module>
    sys.exit(main())
  File "/users/vir/anaconda3/envs/chrombpnet/lib/python3.8/site-packages/chrombpnet/CHROMBPNET.py", line 38, in main
    pipelines.train_bias_pipeline(args)
  File "/users/vir/anaconda3/envs/chrombpnet/lib/python3.8/site-packages/chrombpnet/pipelines.py", line 278, in train_bias_pipeline
    reads_to_bigwig.main(args)
  File "/users/vir/anaconda3/envs/chrombpnet/lib/python3.8/site-packages/chrombpnet/helpers/preprocessing/reads_to_bigwig.py", line 96, in main
    plus_shift, minus_shift = auto_shift_detect.compute_shift(args.input_bam_file,
  File "/users/vir/anaconda3/envs/chrombpnet/lib/python3.8/site-packages/chrombpnet/helpers/preprocessing/auto_shift_detect.py", line 232, in compute_shift
    plus_shift, minus_shift = compute_shift_ATAC(ref_plus_pwms, ref_minus_pwms, plus_pwm, minus_pwm)
  File "/users/vir/anaconda3/envs/chrombpnet/lib/python3.8/site-packages/chrombpnet/helpers/preprocessing/auto_shift_detect.py", line 188, in compute_shift_ATAC
    raise ValueError("Input file shifts inconsistent. Please post an issue")
ValueError: Input file shifts inconsistent. Please post an issue
panushri25 commented 11 months ago

Hey Vivek,

In issue https://github.com/kundajelab/chrombpnet/issues/153 I think they figured that there is some problem with their usage (bam and bed are from different genomic versions). Can you cross check that you are not facing the same problem or any other inconsistencies?

Also what are defined as summits in your peak file?

viramalingam commented 11 months ago

I generated the alignments by running chromap and bed files by running macs3 on those alignments. I got the SRA files and converted them to fastq for alignments. Since I did all of those steps by myself, I don’t think the problem is different genomic versions. The summits are the last column of macs3 narrowpeak right?

On Jan 5, 2024, at 3:33 PM, Anusri Pampari @.***> wrote:



Hey Vivek,

In issue #153https://github.com/kundajelab/chrombpnet/issues/153 I think they figured that there is some problem with their usage (bam and bed are from different genomic versions). Can you cross check that you are not facing the same problem or any other inconsistencies?

Also what are defined as summits in your peak file?

— Reply to this email directly, view it on GitHubhttps://github.com/kundajelab/chrombpnet/issues/169#issuecomment-1879379718, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARZ2STAYDW32HMVEMUVXUY3YNCES3AVCNFSM6AAAAABBMNGWWCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZZGM3TSNZRHA. You are receiving this because you authored the thread.Message ID: @.***>

panushri25 commented 11 months ago

yup

panushri25 commented 11 months ago

(1) Can you run the scripts mentioned in the issue above and share the .pngs that are generated as a part of the output ? (2) Did you try to do any kind of shifts on your input?

viramalingam commented 11 months ago

I do not have bam files. Just the tagalign files from chromap. I run the alignment with the no shift option.

panushri25 commented 10 months ago

For documentation - The reason @viramalingam encountered this error is because his dataset showed a Tn5 motif representation that is more AT-rich and differs from the common reference used in the repository. As a solution, he manually provided shifts to execute the pipeline after building the PWM images from the bigwig and verifying there are no pre-defined shifts in his input.

image

I am closing this @viramalingam as resolved. Feel free to re-open it if you see any more issues.