Giter Site home page Giter Site logo

cflib's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cflib's Issues

FastaToCounts.py not stripping population names as intended

Hi,

First of all thank you for making available this software.

When I coded my identifiers as follows: for example '>pop1-subpop1-ind1' the identifier was stripped at the second dash, instead of the first dash (which is how it is supposed to work according to the documentation).

Cheers

Possibility of converting .vcf file to .fasta ?

Hello Mr Schrempf,

I am a student at the Ngere laboratory in Nancy and as part of my internship, I have to convert fasta files into a .vcf file in order to keep only the mutations present in the sequences, a step that can be carried out using your python script FastaToVCF.py, script allowing to convert only one fasta sequence at a time if it is exact.

But then I am asked from the .vcf files obtained, to convert them into fasta and therefore obtain the fasta sequences with the mutations included.

Do you know if this is possible with your scripts? by digging into the different scripts in the cflib folder and rearranging for example.

Thank you in advance for your answer !

Error when running FastaVCFToCounts.py

Hello

I'm running Python 3.11.14 on MacOS Monterrey.

When executing

vcf_files=(p1.vcf.gz p2.vcf.gz p3.vcf.gz p4.vcf.gz)

python3 FastaVCFToCounts.py anc.fa.gz "${vcf_files[@]}" example_from_fasta_vcf.cf --merge --ploidy 2

I get error

  File "/Users/sb442/Documents/work/DataConversion/cflib/cflib/cf.py", line 766, in __snp
    raise StopIteration()
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/sb442/Documents/work/DataConversion/cflib/scripts/FastaVCFToCounts.py", line 122, in <module>
    cfw.write_Rn(rg)
  File "/Users/sb442/Documents/work/DataConversion/cflib/cflib/cf.py", line 1005, in write_Rn
    (nI, nSNP) = next(snpsG)
                 ^^^^^^^^^^^
RuntimeError: generator raised StopIteration

When I remove line 766 in cf.py raise StopIteration() everything seems to work fine. I get reasonable outputs but I'm not sure if this fix breaks anything else.

Many thanks
Svitlana

FastaVCFToCounts.py error

Hello!

I have been trying to make a count file using the above-mentioned script (installed via pip3).
First, I have created one vcf per population/species (using vcftools), then I used the script as follows:

FastaVCFToCounts.py reference.fasta Pop1.vcf.gz Pop2.vcf.gz Pop3.vcf.gz Pop4.vcf.gz test.counts.gz -p 1 -m

but I am getting the following error:

File "/home/wagner/.local/bin/FastaVCFToCounts.py", line 114, in
cfw.write_Rn(rg)
File "/home/wagner/.local/lib/python3.6/site-packages/cflib/cf.py", line 1002, in write_Rn
self.__fill_cD(iL, snpL)
File "/home/wagner/.local/lib/python3.6/site-packages/cflib/cf.py", line 896, in __fill_cD
bI = dna[altBases[spData[i][d]-1]]
KeyError: '*'

What could be the mistake here?

Thank you in advance!

Error executing FastaToCounts.py

Hi, I'm encountering an error trying to execute the above script.

I've previously tried to install cflib-pomo using pip, but encountered the error with scipy (which I believed you've fixed on an upload to git):

## installed cfllb-pomo from with pip
Traceback (most recent call last):
  File "/home/junhoe/.local/bin/FastaToCounts.py", line 13, in <module>
    import cflib.fasta as fa
  File "/home/junhoe/.local/lib/python3.6/site-packages/cflib/__init__.py", line 12, in <module>
    import cflib.main
  File "/home/junhoe/.local/lib/python3.6/site-packages/cflib/main.py", line 12, in <module>
    from scipy.misc import comb as choose
ImportError: cannot import name 'comb'

Thus I've installed cflib-pomo manually with:
setup.py build
setup.py install

However,now I'm encountering the following error

FastaToCounts.py populations.samples-raw.fa.gz pop.samples-raw.counts.gz --verbose
Traceback (most recent call last):
  File "/lustre/projects/project-junhoe/conda/envs/phylo/bin/FastaToCounts.py", line 4, in <module>
    __import__('pkg_resources').run_script('cflib-pomo==1.2.1', 'FastaToCounts.py')
  File "/lustre/projects/project-junhoe/conda/envs/phylo/lib/python3.6/site-packages/pkg_resources/__init__.py", line 666, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/lustre/projects/project-junhoe/conda/envs/phylo/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1470, in run_script
    exec(script_code, namespace, namespace)
  File "/lustre/projects/project-junhoe/conda/envs/phylo/lib/python3.6/site-packages/cflib_pomo-1.2.1-py3.6.egg/EGG-INFO/scripts/FastaToCounts.py", line 70, in <module>
  File "/lustre/projects/project-junhoe/conda/envs/phylo/lib/python3.6/site-packages/cflib_pomo-1.2.1-py3.6.egg/cflib/cf.py", line 308, in fasta_to_cf
TypeError: exceptions must derive from BaseException

Thanks in advance!

ImportError: No module named 'cflib.fasta'

Installed cflib with easy_install3 on both a Linux and an OS X machine.

I get this error when I try to run a script:

python FastaToCounts.py --help
Traceback (most recent call last):
File "FastaToCounts.py", line 13, in
import cflib.fasta as fa
ImportError: No module named 'cflib.fasta'

I'm sure this is probably an issue with installing cflib. I'd appreciate a more detailed guide.

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.