seq-lang / seq

A high-performance, Pythonic language for bioinformatics
https://seq-lang.org
Apache License 2.0
698 stars 50 forks source link

error: cannot find magic 'matmul' in seq #250

Closed wbszhu closed 2 years ago

wbszhu commented 2 years ago

Hi, I have tried to install it in this way

/bin/bash -c "$(curl -fsSL https://seq-lang.org/install.sh)"

After doing it, everything is ok. But when i run the code as below (test.seq):

seqc run test.seq 

test.seq

# default parameters
s1 = s'CGCGAGTCTT'
s2 = s'CGCAGAGTT'
aln = s1 @ s2
print(aln.cigar, aln.score)

# custom parameters
# match = 2; mismatch = 4; gap1(k) = 2k + 4; gap2(k) = k + 13
aln = s1.align(s2, a=2, b=4, gapo=4, gape=2, gapo2=13, gape2=1)
print(aln.cigar, aln.score)

I got this error

test.seq:4:7: error: cannot find magic 'matmul' in seq

looking forward to your reply.

markhend commented 2 years ago

Hi. Try adding from bio import * at the top. The @ operator in Seq when applied to sequence types, as in your example on line 4, does alignment. In general, you'll need this import for bio-specific features.

wbszhu commented 2 years ago

Hi,

Thanks for the reply, the problem has been solved!

Lu Zhang.