yollct / spycone

Spicing-aware time-course network enricher - exploratory analysis for transcriptomics and/or proteomics time series data
GNU General Public License v3.0
11 stars 0 forks source link

AttributeError: module 'spycone' has no attribute 'dataset' #2

Open Kai08032000 opened 11 months ago

Kai08032000 commented 11 months ago

I am attempting to execute the "transcriptTranscript-level Workflow" as described in the Spycone documentation on a Linux system using Python 3. However, I encounter the following error:

line 21, in <module>
dset = spy.dataset(ts=data,
AttributeError: module 'spycone' has no attribute 'dataset'

I have followed the steps outlined in the documentation and used the provided sample data. Here is the code I used:


import sys
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
sys.path.insert(0, "../../")
import spycone as spy
import subprocess
from gtfparse import read_gtf

#sample data
subprocess.call("wget https://zenodo.org/record/7228475/files/tutorial_alt_sorted_bc_tpm.csv?download=1 -O alt_sorted_bc_tpm.csv", shell=True)
subprocess.call("wget https://zenodo.org/record/7228475/files/tutorial_alt_genelist.csv?download=1 -O alt_genelist.csv", shell=True)

data = pd.read_csv("alt_sorted_bc_tpm.csv", sep="\t")
genelist = pd.read_csv("alt_genelist.csv", sep="\t")

geneid= list(map(lambda x: str(int(x)) if not np.isnan(x) else x,  genelist['gene'].tolist()))
transcriptid = genelist['isoforms'].to_list()

dset = spy.dataset(ts=data,
        transcript_id=transcriptid,
        gene_id = geneid,
        species=9606,
        # keytype='entrezgeneid',
        timepts=4, reps1=3)

bionet = spy.BioNetwork(path="human", data=(('weight',float),))

spy.preprocess(dset, bionet, cutoff=1)

iso = spy.iso_function(dset)
#run isoform switch
ascov=iso.detect_isoform_switch(filtering=False, min_diff=0.05, corr_cutoff=0.5, event_im_cutoff=0.1, p_val_cutoff=0.05)

ascov.head()

#matplotlib inline
spy.switch_plot("CDK4", dset, ascov)

#%matplotlib inline
spy.switch_plot("BRCC3", dset, ascov, all_isoforms=True)

I have commented out the %matplotlib inline lines as they were causing a SyntaxError. Despite this, I am still encountering the "AttributeError" mentioned earlier. I am uncertain about the cause of this issue and would appreciate your guidance on how to resolve it and successfully run the "transcriptTranscript-level Workflow."

Thank you for your assistance.

yollct commented 10 months ago

Hi,

Thank you for your message! Sorry for the late reply. I wasn't notified by anything about this issue.

So I haven't encountered this error. Could you please specify the spycone version and the python version (3.x)? Also which code editor are you using?

Thanks, Chit Tong