Giter VIP home page Giter VIP logo

cmseq's People

Contributors

azufre451 avatar fasnicar avatar fbeghini avatar karchern avatar kd-huang avatar maxibor avatar nsegata avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cmseq's Issues

poly.py to support multithreading?

Hi

Thanks for a great tool. It is really valuable to be able to calculate SNP frequencies.

Any chance that poly.py will support multithreading?

Best regards
Rasmus

polymut.py error reading gff file ?

Hi there,

I'm trying to run polymut.py on a sorted, indexed bam and gff file output from Prokka as follows:

polymut.py --mincov 10 --gff_file test_prokka.gff test.bam

and I am getting the following error:

Traceback (most recent call last):
  File "/gstore/scratch/u/tamburif/miniconda3_envs/cmseq/lib/python3.7/site-packages/Bio/SeqIO/Interfaces.py", line 42, in __init__
    self.stream = open(source, "r" + mode)
TypeError: expected str, bytes or os.PathLike object, not FakeHandle

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/gstore/scratch/u/tamburif/miniconda3_envs/cmseq/bin/polymut.py", line 10, in <module>
    sys.exit(polymut_from_file())
  File "/gstore/scratch/u/tamburif/miniconda3_envs/cmseq/lib/python3.7/site-packages/cmseq/polymut.py", line 33, in polymut_from_file
    bf.parse_gff(args.gff_file)
  File "/gstore/scratch/u/tamburif/miniconda3_envs/cmseq/lib/python3.7/site-packages/cmseq/cmseq.py", line 115, in parse_gff
    for rec in GFF.parse(in_handle):
  File "/gstore/scratch/u/tamburif/miniconda3_envs/cmseq/lib/python3.7/site-packages/BCBio/GFF/GFFParser.py", line 746, in parse
    target_lines):
  File "/gstore/scratch/u/tamburif/miniconda3_envs/cmseq/lib/python3.7/site-packages/BCBio/GFF/GFFParser.py", line 322, in parse_in_parts
    for results in self.parse_simple(gff_files, limit_info, target_lines):
  File "/gstore/scratch/u/tamburif/miniconda3_envs/cmseq/lib/python3.7/site-packages/BCBio/GFF/GFFParser.py", line 343, in parse_simple
    for results in self._gff_process(gff_files, limit_info, target_lines):
  File "/gstore/scratch/u/tamburif/miniconda3_envs/cmseq/lib/python3.7/site-packages/BCBio/GFF/GFFParser.py", line 637, in _gff_process
    for out in self._lines_to_out_info(line_gen, limit_info, target_lines):
  File "/gstore/scratch/u/tamburif/miniconda3_envs/cmseq/lib/python3.7/site-packages/BCBio/GFF/GFFParser.py", line 699, in _lines_to_out_info
    fasta_recs = self._parse_fasta(FakeHandle(line_iter))
  File "/gstore/scratch/u/tamburif/miniconda3_envs/cmseq/lib/python3.7/site-packages/BCBio/GFF/GFFParser.py", line 560, in _parse_fasta
    return list(SeqIO.parse(in_handle, "fasta"))
  File "/gstore/scratch/u/tamburif/miniconda3_envs/cmseq/lib/python3.7/site-packages/Bio/SeqIO/__init__.py", line 627, in parse
    i = iterator_generator(handle)
  File "/gstore/scratch/u/tamburif/miniconda3_envs/cmseq/lib/python3.7/site-packages/Bio/SeqIO/FastaIO.py", line 181, in __init__
    super().__init__(source, alphabet=alphabet, mode="t", fmt="Fasta")
  File "/gstore/scratch/u/tamburif/miniconda3_envs/cmseq/lib/python3.7/site-packages/Bio/SeqIO/Interfaces.py", line 46, in __init__
    if source.read(0) != "":
TypeError: read() takes 1 positional argument but 2 were given

I can confirm that the contig names match between the bam and gff files.

I'm using the latest conda version (1.0) and it would be very helpful to keep using conda so that I can incorporate this analysis into a Snakemake workflow. I did try cloning this repo and running the script from there to try and troubleshoot whether the problem was with the conda version or my specific files, but I got a different error in doing so:

Traceback (most recent call last):
  File "/gstore/home/tamburif/tools/cmseq/cmseq/polymut.py", line 6, in <module>
    from .cmseq import CMSEQ_DEFAULTS
ImportError: attempted relative import with no known parent package

Your help is much appreciated! Thank you!
Fiona

polymut.py script does not work properly

Dear developer / SegataLab,

Thank you for the useful tool!

The poly.py worked great for my MAGs analysis for SNPs, however the polymut.py did not work.
You have written in the doc: "Please supply a gff file from roary and make sure that the contig names between the bam file and the gff file can be matched.".
Roary does not output a gff file, but rather Prokka produce gff file that can be used with Roary - is this what you meant? (this gff file has both gene annotations and the nucleotide sequence of the contigs). I have confiremd the matching of the contigs header.

When I run polymut.py with the bam and gff files of my MAG, after 10-20min it finished without any errors, but the output file had just 3 numbers in a single line (65.0 79.0 4169686.0).

Any ideas / advises will be greatly welcomed.

Lastly, for CMSeq requirements need to be added: Bio and bcbio-gff modules.

Best regards
Vadim

Biopython error with consensus.py

Hi there,

I'm new to cmseq, but it looks like a very recent change to Biopython (Bio.Alphabet removal) has led to the following error.

consensus.py --help
Traceback (most recent call last):
  File "/users/ibishop/anaconda/proov/bin/consensus.py", line 7, in <module>
    from cmseq.consensus import consensus_from_file
  File "/users/ibishop/anaconda/proov/lib/python3.8/site-packages/cmseq/consensus.py", line 9, in <module>
    from Bio.Alphabet import IUPAC
  File "/users/ibishop/anaconda/proov/lib/python3.8/site-packages/Bio/Alphabet/__init__.py", line 20, in <module>
    raise ImportError(
ImportError: Bio.Alphabet has been removed from Biopython. In many cases, the alphabet can simply be ignored and removed from scripts. In a few cases, you may need to specify the ``molecule_type`` as an annotation on a SeqRecord for your script to work correctly. Please see https://biopython.org/wiki/Alphabet for more information.

I installed via bioconda.
Any help or clarification is much appreciated! -i

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.