epi2me-labs / ont-spectre

Other
0 stars 0 forks source link

AttributeError: 'Expr' object has no attribute 'apply' #1

Open rgal-mcw opened 1 month ago

rgal-mcw commented 1 month ago

Hi!

I'm attempting to use ont-spectre for CNV calling on our data by using the following command:

spectre CNVCaller \
  --bin-size 1000 \
  --coverage $MOSDEPTH \
  --sample-id $SAMPLE \
  --output-dir "${DIR_PATH}/spectre/" \
  --reference /data/ref/NCBI/GRCh38/Homo_sapiens_assembly38_noALT_noHLA_noDecoy_ERCC.fasta \
  --snv "${DIR_PATH}/snp_indel/clair3/phased_merge_output.vcf.gz" \

Where -$MOSDEPTH is a directory where my Mosdepth files are stored for this sample -$SAMPLE is my sample name ---snv "${DIR_PATH}/snp_indel/clair3/phased_merge_output.vcf.gz" is my clair3 generated SNV .vcf for this same sample.

I'm attaching the whole run log to this issue for your review. 08012024_log.txt

I'm running this in a dedicated conda environment where the packages listed in requirements.txt are the only ones I've installed.

It appears that there is an issue parsing the SNV .vcf - something to do with Polars dataframe. The SNV .vcf is unchanged from the Clair3 output.

Any further insight to this is appreciated!

-Ryan

snurk commented 2 weeks ago

Dear @rgal-mcw, thank you for the report. The issue is related to the breaking change in polars API starting from version 1.0. Problem will be fixed in the upcoming version of ont-spectre, but in the meantime you can modify requirements.txt to force it using an older version of polars. In particular, you can change polars[pyarrow]>=0.19.15 to use == (or ~=, which should get latest available 0.x version of polars).

-Sergey