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

CRISPRessoPooled not always writing to .info file #377

Closed
npklein opened this issue Feb 13, 2024 · 3 comments
Closed

CRISPRessoPooled not always writing to .info file #377

npklein opened this issue Feb 13, 2024 · 3 comments

Comments

@npklein
Copy link

npklein commented Feb 13, 2024

Describe the bug

I'm not sure if this is expected behavior or not, but at

with open(chr_output_filename, 'r') as f_in:
MAPPED_REGIONS/*.info files are expected, but they are only written if the full chromosome is run (without chunking).

In

sub_chr_command = chr_cmd.replace("__REGION__", ":%d-%d "%(curr_pos, curr_end))
and 1177 I think (if .info files should be written for all chunks) that:

sub_chr_command = chr_cmd.replace("__REGION__", ":%d-%d "%(curr_pos, curr_end))                                
chr_output_filename = _jp('MAPPED_REGIONS/%s_%s_%s.info' % (chr_str, curr_pos, curr_end))

should be replaced by:

chr_output_filename = _jp('MAPPED_REGIONS/%s_%s_%s.info' % (chr_str, curr_pos, curr_end))
sub_chr_command = chr_cmd.replace("__REGION__", ":%d-%d "%(curr_pos, curr_end)).replace("__DEMUX_CHR_LOGFILENAME__",chr_output_filename)               

as this is also in https://github.com/pinellolab/CRISPResso2/blob/2b163927faa4ca37a1dc8294ffd1c18dd057b62e/CRISPResso2/CRISPRessoPooledCORE.py#L1184C191.

If .info files should not be written for all chunks, can resolve this issue

@kclem
Copy link
Member

kclem commented Mar 6, 2024

Hi @npklein are the .info files useful to you? I had avoided writing them for the chunking options because it would potentially create a lot of files.

@npklein
Copy link
Author

npklein commented Mar 7, 2024

I'm not sure if I am using CRISPResso wrong, but in

with open(REPORT_ALL_DEPTH, 'w') as f:
    f.write('chr_id\tstart\tend\tnumber of reads\toutput filename\n')
        for chr_output_filename in chr_output_filenames:
            with open(chr_output_filename, 'r') as f_in:
                for line in f_in:
                    f.write(line)

it is reading the info files as far as I can see, so without writing them the chunking doesn't work.

@kclem kclem closed this as completed in de182d2 Mar 7, 2024
@kclem
Copy link
Member

kclem commented Mar 7, 2024

Hi npklein - just pushed this fix now.

mbowcut2 pushed a commit to edilytics/CRISPResso2 that referenced this issue Mar 8, 2024
mbowcut2 pushed a commit to edilytics/CRISPResso2 that referenced this issue Mar 20, 2024
mbowcut2 pushed a commit to edilytics/CRISPResso2 that referenced this issue Jun 19, 2024
mbowcut2 pushed a commit to edilytics/CRISPResso2 that referenced this issue Nov 8, 2024
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