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.