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

The Kernel crashed when I run tfi.scan #207

Open
Zhangruiqi111 opened this issue Jul 12, 2024 · 1 comment
Open

The Kernel crashed when I run tfi.scan #207

Zhangruiqi111 opened this issue Jul 12, 2024 · 1 comment

Comments

@Zhangruiqi111
Copy link

When I run this command : tfi.scan(fpr=0.02,motifs=None, verbose=True)
Error reported as follows : The Kernel crashed while executing code in the current cell or a previous cell.
So I do it in batches ,100 rows are processed at a time ,
`import math
peaks = pd.read_csv("cicero_output/processed_peak_file.csv", index_col=0)
peaks = peaks[2000:3000]
df_results = []
batch_size = 100
num_batches = math.ceil(len(peaks)/100)

def process_batch(batch_peaks):
tfi = ma.TFinfo(peak_data_frame=batch_peaks, ref_genome=ref_genome, genomes_dir=None)
tfi.scan(fpr=0.02, motifs=None, verbose=True)
tfi.reset_filtering()
tfi.filter_motifs_by_score(threshold=10)
tfi.make_TFinfo_dataframe_and_dictionary(verbose=True)
return tfi.to_dataframe()

for batch_index in range(num_batches):
start_index = batch_index * batch_size
end_index = min((batch_index + 1) * batch_size, len(peaks))
batch_peaks = peaks.iloc[start_index:end_index].copy()
df = process_batch(batch_peaks)
df_results.append(df)`

But an error is still reported :
The Kernel crashed while executing code in the current cell or a previous cell.
I installed gimmemotifs with conda first and then celloracle with pip , But it didn't work.
So I think there is something wrong with the data :(

@baoa2ta
Copy link

baoa2ta commented Oct 20, 2024

Were able to solve this issue? I am having the same problem

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