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

is it SAM/BAM format? #181

Open
gorliver opened this issue Feb 15, 2024 · 0 comments
Open

is it SAM/BAM format? #181

gorliver opened this issue Feb 15, 2024 · 0 comments

Comments

@gorliver
Copy link

I got the following message from fanc pairs:

2024-02-15 23:34:14,038 INFO FAN-C version: 0.9.23
2024-02-15 23:34:14,041 INFO Getting genome regions (fragments or bins)
2024-02-15 23:34:14,041 INFO Getting regions
2024-02-15 23:34:14,045 INFO Three arguments detected, assuming SAM/BAM input.
2024-02-15 23:34:14,047 INFO Using filters appropriate for BWA.
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/share/apps/miniconda3/envs/bio/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/share/apps/miniconda3/envs/bio/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/share/apps/miniconda3/envs/bio/lib/python3.7/site-packages/fanc/pairs.py", line 171, in _split_sam_worker
    check_sorted=check_sorted):
  File "/share/apps/miniconda3/envs/bio/lib/python3.7/site-packages/fanc/tools/files.py", line 420, in split_sam_pairs
    output_file.write(read.to_string() + '\n')
AttributeError: 'pysam.calignedsegment.AlignedSegment' object has no attribute 'to_string'

Process SpawnPoolWorker-2:
Traceback (most recent call last):
  File "/share/apps/miniconda3/envs/bio/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/share/apps/miniconda3/envs/bio/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/share/apps/miniconda3/envs/bio/lib/python3.7/multiprocessing/pool.py", line 105, in worker
    initializer(*initargs)
  File "/share/apps/miniconda3/envs/bio/lib/python3.7/site-packages/fanc/pairs.py", line 226, in _load_paired_sam_worker
    for read1, read2 in pair_generator:
  File "/share/apps/miniconda3/envs/bio/lib/python3.7/site-packages/fanc/pairs.py", line 487, in __iter__
    for (read1, read2) in self._iter_read_pairs():
  File "/share/apps/miniconda3/envs/bio/lib/python3.7/site-packages/fanc/pairs.py", line 752, in _iter_read_pairs
    sam = pysam.AlignmentFile(self.sam_file)
  File "pysam/calignmentfile.pyx", line 340, in pysam.calignmentfile.AlignmentFile.__cinit__
  File "pysam/calignmentfile.pyx", line 589, in pysam.calignmentfile.AlignmentFile._open
ValueError: file has no sequences defined (mode='r') - is it SAM/BAM format? Consider opening with check_seq=True

The command is:

fanc pairs -f -g references/ge_assembly_100bp.bed -us --bwa -S V35/sam/V35_L1_r1.bam V35/sam/V35_L1_r2.bam V35/pairs/V35_l1.pairs

The bam files were generated using fanc map and everything looked fine.
Any suggestions are highly appreciated.

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

1 participant