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

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

Open
Kai08032000 opened this issue Oct 14, 2023 · 1 comment
Open

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

Kai08032000 opened this issue Oct 14, 2023 · 1 comment

Comments

@Kai08032000
Copy link

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
Copy link
Owner

yollct commented Nov 14, 2023

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

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