Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test run gives pysam error #10

Open
andosl opened this issue Apr 22, 2023 · 3 comments
Open

Test run gives pysam error #10

andosl opened this issue Apr 22, 2023 · 3 comments

Comments

@andosl
Copy link

andosl commented Apr 22, 2023

Traceback (most recent call last):
File "/home/msgroup/anaconda3/envs/IGv2/bin/IG", line 11, in
load_entry_point('IGenotyper==1.1', 'console_scripts', 'IG')()
File "/home/msgroup/anaconda3/envs/IGv2/lib/python2.7/site-packages/IGenotyper-1.1-py2.7.egg/IGenotyper/main.py", line 35, in main
command.main(args)
File "/home/msgroup/anaconda3/envs/IGv2/lib/python2.7/site-packages/IGenotyper-1.1-py2.7.egg/IGenotyper/commands/phase.py", line 120, in main
run_phasing(**vars(args))
File "/home/msgroup/anaconda3/envs/IGv2/lib/python2.7/site-packages/IGenotyper-1.1-py2.7.egg/IGenotyper/commands/phase.py", line 114, in run_phasing
phasing_stats(sample,files,plot_command_line,align_command_line)
File "/home/msgroup/anaconda3/envs/IGv2/lib/python2.7/site-packages/IGenotyper-1.1-py2.7.egg/IGenotyper/phasing/stats.py", line 290, in phasing_stats
stats = input_stats(files,primary_alignment_bam)
File "/home/msgroup/anaconda3/envs/IGv2/lib/python2.7/site-packages/IGenotyper-1.1-py2.7.egg/IGenotyper/phasing/stats.py", line 86, in input_stats
regions_covered = target_region_coverage(files,primary_alignment_bam)
File "/home/msgroup/anaconda3/envs/IGv2/lib/python2.7/site-packages/IGenotyper-1.1-py2.7.egg/IGenotyper/phasing/stats.py", line 30, in target_region_coverage
for pileupcolumn in sam.pileup(chrom,start,end):
File "pysam/libcalignmentfile.pyx", line 1326, in pysam.libcalignmentfile.AlignmentFile.pileup
File "pysam/libchtslib.pyx", line 685, in pysam.libchtslib.HTSFile.parse_region
ValueError: invalid contig ighc
IG_phase_output.txt

@Xiujia-Yang
Copy link

The absence of the ighc record in the reference sequences /home/msgroup/anaconda3/envs/IGv2/lib/python2.7/site-packages/IGenotyper-1.1-py2.7.egg/IGenotyper/data/reference.fasta should be responsible for this issue. Thus, it can be solved by deleting the record of ighc in the bed file /home/msgroup/anaconda3/envs/IGv2/lib/python2.7/site-packages/IGenotyper-1.1-py2.7.egg/IGenotyper/data/target_region.bed.

@veredkl
Copy link

veredkl commented Aug 24, 2023

I have the above error, so I delete the record of ighc in the bed file but new I get different error.
I run it on your example file.

Checking test111/plots/phasing.png
Running command...
CONDA_BASE=$(conda info --base)
source ${CONDA_BASE}/etc/profile.d/conda.sh
conda activate pygenometracks
pyGenomeTracks --tracks test111/tmp/pygenometracks.ini --region igh:1-1193129 -o test111/plots/phasing.png
Traceback (most recent call last):
File "/home/user/veredk/.conda/envs/pygenometracks/lib/python3.7/site-packages/pygenometracks/tracksClass.py", line 577, in check_file_exists
open(file_name_to_check, 'r').close()
FileNotFoundError: [Errno 2] No such file or directory: 'test111/tmp/hap0.bw'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/user/veredk/.conda/envs/pygenometracks/lib/python3.7/site-packages/pygenometracks/tracksClass.py", line 585, in check_file_exists
open(name_with_tracks_path_to_check, 'r').close()
FileNotFoundError: [Errno 2] No such file or directory: 'test111/tmp/test111/tmp/hap0.bw'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/user/veredk/.conda/envs/pygenometracks/bin/pyGenomeTracks", line 11, in
main(args)
File "/home/user/veredk/.conda/envs/pygenometracks/lib/python3.7/site-packages/pygenometracks/plotTracks.py", line 321, in main
plot_regions=regions, plot_width=args.plotWidth)
File "/home/user/veredk/.conda/envs/pygenometracks/lib/python3.7/site-packages/pygenometracks/tracksClass.py", line 78, in init
self.parse_tracks(tracks_file, plot_regions=plot_regions)
File "/home/user/veredk/.conda/envs/pygenometracks/lib/python3.7/site-packages/pygenometracks/tracksClass.py", line 512, in parse_tracks
track_options['file_type'] == 'hic_matrix')
File "/home/user/veredk/.conda/envs/pygenometracks/lib/python3.7/site-packages/pygenometracks/tracksClass.py", line 588, in check_file_exists
raise InputError(f"File in section [{track_dict['section_name']}] "
pygenometracks.utilities.InputError: File in section [8. [hap 0 bw]] not found:
test111/tmp/hap0.bw

output.txt

@Xiujia-Yang
Copy link

I have the above error, so I delete the record of ighc in the bed file but new I get different error. I run it on your example file.

Checking test111/plots/phasing.png Running command... CONDA_BASE=$(conda info --base) source ${CONDA_BASE}/etc/profile.d/conda.sh conda activate pygenometracks pyGenomeTracks --tracks test111/tmp/pygenometracks.ini --region igh:1-1193129 -o test111/plots/phasing.png Traceback (most recent call last): File "/home/user/veredk/.conda/envs/pygenometracks/lib/python3.7/site-packages/pygenometracks/tracksClass.py", line 577, in check_file_exists open(file_name_to_check, 'r').close() FileNotFoundError: [Errno 2] No such file or directory: 'test111/tmp/hap0.bw'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/user/veredk/.conda/envs/pygenometracks/lib/python3.7/site-packages/pygenometracks/tracksClass.py", line 585, in check_file_exists open(name_with_tracks_path_to_check, 'r').close() FileNotFoundError: [Errno 2] No such file or directory: 'test111/tmp/test111/tmp/hap0.bw'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/user/veredk/.conda/envs/pygenometracks/bin/pyGenomeTracks", line 11, in main(args) File "/home/user/veredk/.conda/envs/pygenometracks/lib/python3.7/site-packages/pygenometracks/plotTracks.py", line 321, in main plot_regions=regions, plot_width=args.plotWidth) File "/home/user/veredk/.conda/envs/pygenometracks/lib/python3.7/site-packages/pygenometracks/tracksClass.py", line 78, in init self.parse_tracks(tracks_file, plot_regions=plot_regions) File "/home/user/veredk/.conda/envs/pygenometracks/lib/python3.7/site-packages/pygenometracks/tracksClass.py", line 512, in parse_tracks track_options['file_type'] == 'hic_matrix') File "/home/user/veredk/.conda/envs/pygenometracks/lib/python3.7/site-packages/pygenometracks/tracksClass.py", line 588, in check_file_exists raise InputError(f"File in section [{track_dict['section_name']}] " pygenometracks.utilities.InputError: File in section [8. [hap 0 bw]] not found: test111/tmp/hap0.bw

output.txt

This error can be ignored as the tutorial indicates (code block under Testing IGenotyper installation). This is because hap0.bw is a file storing the coverage statistics for unphased reads. This file is missing because of the absence of unphased reads curated in 0.bam. hap0.bw is used to visualize the coverage details for unphased reads, a step having no influence on the subsequent assembly utility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants