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

Bug with sequence length #7

Open
celiosantosjr opened this issue Oct 11, 2019 · 1 comment
Open

Bug with sequence length #7

celiosantosjr opened this issue Oct 11, 2019 · 1 comment

Comments

@celiosantosjr
Copy link

celiosantosjr commented Oct 11, 2019

I am testing CAI package following your instructions and I got a bug when processing small sequences. My sequence is:

>testseq
ATGAAATTAATATTGAAACTCGTGGAACGGAAAAAACTGATCAAGGAGTTAAAAGAAGATATTGAAGTAATTTAA

Then, when I execute the program:

>>> reference = [seq.seq for seq in SeqIO.parse("../database/annotation/1036673.PRJNA67335/1036673.PRJNA67335.ffn", "fasta")]
>>> CAI(sequence, reference=reference)

I receive this message:

  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/CAI/CAI.py", line 220, in CAI
    weights = relative_adaptiveness(sequences=reference, genetic_code=genetic_code)
  File "/usr/local/lib/python3.7/dist-packages/CAI/CAI.py", line 149, in relative_adaptiveness
    RSCUs = RSCU(sequences, genetic_code=genetic_code)
  File "/usr/local/lib/python3.7/dist-packages/CAI/CAI.py", line 75, in RSCU
    raise ValueError("Input sequence not divisible by three")
ValueError: Input sequence not divisible by three

The problem is, this is a coding sequence that we work for long time now and it is divisible in codons (presents even the start and stop codon there). So, I do not know what is misinterpreted by the package. I look forward to hearing from you.

@HarryMWinters
Copy link

Have you tried? In case some white space is getting in there.

reference = [seq.seq for seq in SeqIO.parse("../database/annotation/1036673.PRJNA67335/1036673.PRJNA67335.ffn", "fasta")]
CAI(sequence.strip(), reference=reference)

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