Magdoll / SQANTI2

SQANTI2 is now replaced by SQANTI3. Please go to: https://github.com/ConesaLab/SQANTI3
Other
38 stars 15 forks source link

AttributeError when running squanti2 #11

Closed hvbakel closed 5 years ago

hvbakel commented 5 years ago

Ok, I'm making progress in getting the latest version of squanti2 to run, but I've now hit the error below. I wonder if there has been a change in biopython that causes the issue or if there is any other version incompatibility. Have you perhaps encountered this issue before?

Traceback (most recent call last):
  File "/sc/orga/projects/vanbah01a/opt/SQANTI2//sqanti_qc2.py", line 1539, in <module>
    main()
  File "/sc/orga/projects/vanbah01a/opt/SQANTI2//sqanti_qc2.py", line 1535, in main
    run(args)
  File "/sc/orga/projects/vanbah01a/opt/SQANTI2//sqanti_qc2.py", line 1181, in run
    orfDict = correctionPlusORFpred(args, genome_dict)
  File "/sc/orga/projects/vanbah01a/opt/SQANTI2//sqanti_qc2.py", line 363, in correctionPlusORFpred
    err_correct(args.genome, corrSAM, corrFASTA, genome_dict=genome_dict)
  File "/sc/orga/projects/vanbah01a/opt/cDNA_Cupcake/sequence/err_correct_w_genome.py", line 31, in err_correct
    seq = sp.consistute_genome_seq_from_exons(genome_dict, r.sID, r.segments, r.flag.strand)
  File "/sc/orga/projects/vanbah01a/opt/cDNA_Cupcake/sequence/coordinate_mapper.py", line 190, in consistute_genome_seq_from_exons
    return seq.tostring()
AttributeError: 'Seq' object has no attribute 'tostring'
Magdoll commented 5 years ago

Can you check the biopython version?

>>> import Bio
>>> Bio.__version__
'1.71'
hvbakel commented 5 years ago

The biopython version I'm using is 1.73.

On 3/12/19 5:24 AM, Elizabeth Tseng wrote:

Can you check the biopython version?

import Bio Bio.version '1.71'

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Magdoll_SQANTI2_issues_11-23issuecomment-2D471916624&d=DwMCaQ&c=shNJtf5dKgNcPZ6Yh64b-A&r=ZtaKHYT_gM9Z582vws54FKvtCu9LUxHiMqiG1PJlVqA&m=amD3Dmz-WTmsxR-Ggh5gbIxf6qtm-GHeNmoYJZ5CZEI&s=kLdlSGPJms46eifbZJx_bBdZiDtyGdKpwsNWgk_phHw&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ABAWCUv-5FFHcbccu-5FY6IfmCz16aEDiBtRks5vV3JUgaJpZM4bpQvi&d=DwMCaQ&c=shNJtf5dKgNcPZ6Yh64b-A&r=ZtaKHYT_gM9Z582vws54FKvtCu9LUxHiMqiG1PJlVqA&m=amD3Dmz-WTmsxR-Ggh5gbIxf6qtm-GHeNmoYJZ5CZEI&s=USYIq2ashKgJa2m6twRg-IrKHof2qeQChhUrMRmHFIs&e=.

hvbakel commented 5 years ago

Ok, I got everything working by downgrading biopython to v1.71.

For reference, I used the following commands to set up the conda environment:

# Set up conda channels following biopython recommendations                                                                                                                                                                                        
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge

# Install conda environment for SQUANTI2                                                                                                                                                                                                    
conda create -n anaCogent5.2 python=2.7 pysam psutil biopython=1.71 bx-python bcbiogff

This setup follows the guidelines provided by biopython in terms of channel ordering. Without it, I ran into difficulties with incompatible numpy versions. Also, http://conda.anaconda.org/cgat no longer appears to list bx-python. You might want to update the installation notes in the readme files.

As a final note, I noticed that the 'transcript_coord' isn't implemented yet in the junction file. In our pipeline we use this coordinate to identify premature termination codons (ptc). If possible, it would be great to have this functionality restored (or just have ptc detection integrated in squanti2).

Magdoll commented 5 years ago

Hi @hvbakel ,

Thanks for noticing this. I'll make note.

And yes...will put transcript_coord back in the future. I have some more CDS related features in mind.

--Liz

Magdoll commented 5 years ago

Updated Cupcake to v7.2 that used str() instead of .tostring() for Bio.Seq objects.

navajeet123 commented 4 years ago

Dear Author, Can you please help to resolve the error!

Running SQANTI... Parsing provided files.... Reading genome fasta Sqanti2/SQANTI2-master/1.fasta.masked.... Aligning reads with Minimap2... Predicting ORF sequences... **** Parsing Reference Transcriptome.... Traceback (most recent call last): File "./sqanti_qc2.py", line 1794, in main() File "./sqanti_qc2.py", line 1790, in main run(args) File "./sqanti_qc2.py", line 1418, in run refs_1exon_by_chr, refs_exons_by_chr, junctions_by_chr, junctions_by_gene, start_ends_by_gene = reference_parser(args, list(genome_dict.keys())) File "./sqanti_qc2.py", line 625, in reference_parser for r in genePredReader(referenceFiles): File "./sqanti_qc2.py", line 124, in init self.f = open(filename) FileNotFoundError: [Errno 2] No such file or directory: '/Sqanti2/SQANTI2-master/refAnnotation_OUT.genePred'

====================

command: python ./sqanti_qc2.py --aligner_choice minimap2 Isoseq.fasta augustus.ab_initio.gtf 1.fasta.masked -o OUT

Thanks

Magdoll commented 4 years ago

This is most often an issue with not having gtfToGenePred properly in your $PATH or having the right version of it. Please check with the install directions here