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

AttributeError: 'list' object has no attribute 'name' #1385

Open
szakallasn3 opened this issue Mar 5, 2025 · 1 comment
Open

AttributeError: 'list' object has no attribute 'name' #1385

szakallasn3 opened this issue Mar 5, 2025 · 1 comment

Comments

@szakallasn3
Copy link

Hi. I try to compare two .bam files. The inputs are sorted and indexed. They were aligned to the same reference genome: GRCh38. I assume that It is important to mention, that these .bams corresponds to the same sample, but one of them earned by Nanopore and one by Illumina sequencing. My goal is to summarize the overlapping regions.

When I try to run the following code:
bamCompare -b1 file1.bam -b2 file2.bam -o output.log2ratio.bw

I got this error message:

File "/opt/anaconda3/bin/bamCompare", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/anaconda3/lib/python3.12/site-packages/deeptools/bamCompare.py", line 310, in main
    wr.run(FUNC, func_args, args.outFileName, blackListFileName=args.blackListFileName, format=args.outFileFormat, smoothLength=args.smoothLength)
  File "/opt/anaconda3/lib/python3.12/site-packages/deeptools/writeBedGraph.py", line 134, in run
    chrom_names_and_size, non_common = getCommonChrNames(bam_handles, verbose=False)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/lib/python3.12/site-packages/deeptools/utilities.py", line 209, in getCommonChrNames
    "lengths from file\n{}\n".format(bamFileHandles.name))
                                     ^^^^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'name'

Do you have any suggestion regarding this issue?

@WardDeb
Copy link
Member

WardDeb commented Mar 5, 2025

This indeed is a bug in the error reporting, but the underlying problem is that there are no common chromosomes in file1.bam and file2.bam, you should double check that..

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

2 participants