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

problem with initializeScenic() #471

Open
Mancang-Yu opened this issue Nov 25, 2024 · 1 comment
Open

problem with initializeScenic() #471

Mancang-Yu opened this issue Nov 25, 2024 · 1 comment

Comments

@Mancang-Yu
Copy link

image
Hi,I have some trouble with initializeScenic().I download the file from this site(https://resources.aertslab.org/cistarget/databases/mus_musculus/mm9/refseq_r45/mc9nr/gene_based/). But I find the file names have some differences with the required file name. So I rename the files. When I run initializeScenic(), I got an error"Error in eval(as.name(motifAnnotName)): can't fine the object 'motifAnnotations_mgi'".Is there something wrong?

@basetwin
Copy link

basetwin commented Dec 6, 2024

Hi,

I’ve encountered a similar problem before, and in my case, it was caused by a mismatch between the predicted file format (older version) and the new database file format. Specifically, the older format had a feature column as the first column, while the newer database format uses a motif column, which appears as the last column.

To resolve this, I renamed the motif column to feature and moved it to be the first column. This adjustment aligned the file with the expected format and resolved the issue for me.

I hope this helps! Let me know if you need further clarification.

like this code

dir = input('Please enter the directory of files which you want to change: ')
#dir = '/gpfs/home2/sbjs0428/tutorial/R/scenic_heochan/cisTarget_databases'

for file in os.listdir(dir):
    if file.endswith('feather'):
        name = file
        df = pd.read_feather(file)
        df = df.rename(columns={'motifs':'features'})
        columns = ['features'] + [col for col in df.columns if col != 'features']
        df = df[columns]
        df.to_feather(name)

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