diff --git a/README.md b/README.md index d5cacdc0..9fc26ff4 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,4 @@ Pipeline based on snakemake to process ChIP-seq, ATAC-seq, RNA-seq and short read WGS data for SNP calling. -See the [SeqNado documentation](alsmith151.github.io/SeqNado/) for more information. +See the SeqNado documentation https://alsmith151.github.io/SeqNado/ for more information. diff --git a/docs/faq.md b/docs/faq.md index dc2bee65..db82e587 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -5,3 +5,17 @@ ### Workflow defines configfile config_chip.yml but it is not present or accessible. This error occurs when the pipeline is run without a config file present in the working directory. Follow the [Pipeline Setup](pipeline.md#create-a-design-file) instructions to create a config file. + + +## Singularity configuration + +### Workflow Error + +Failed to pull singularity image from library://asmith151/seqnado/seqnado_pipeline:latest: +FATAL: Unable to get library client configuration: +remote has no library client (see https://apptainer.org/docs/user/latest/endpoint.html#no-default-remote) + +Fix: + +apptainer remote add --no-login SylabsCloud cloud.sylabs.io +apptainer remote use SylabsCloud \ No newline at end of file diff --git a/docs/pipeline.md b/docs/pipeline.md index d5fdebcb..1e887fd3 100644 --- a/docs/pipeline.md +++ b/docs/pipeline.md @@ -10,6 +10,11 @@ The following command will generate the working directory and configuration file ```bash seqnado-config chip + +# options +-r, --rerun # Re-run the config +-g, --genome [dm6|hg19|hg38|hg38_dm6|hg38_mm39|hg38_spikein|mm10|mm39|other] # Genome to use if genome preset is configured + ``` You should get somthing like this: diff --git a/seqnado/cli.py b/seqnado/cli.py index d8e5ee7b..bc76e8fb 100644 --- a/seqnado/cli.py +++ b/seqnado/cli.py @@ -9,6 +9,7 @@ @click.command(context_settings=dict(ignore_unknown_options=True)) @click.argument("method", type=click.Choice(["atac", "chip", "rna", "snp"])) +@click.option("-r", "--rerun", is_flag=True, help="Re-run the config") @click.option( "-g", "--genome", @@ -28,13 +29,13 @@ ] ), ) -def cli_config(method, help=False, genome="other"): +def cli_config(method, help=False, genome="other", rerun=False): """ Runs the config for the data processing pipeline. """ import seqnado.config as config - config.create_config(method, genome) + config.create_config(method, genome, rerun) @click.command() diff --git a/seqnado/config.py b/seqnado/config.py index ee1cc3f8..a36d0d6a 100644 --- a/seqnado/config.py +++ b/seqnado/config.py @@ -178,7 +178,7 @@ def setup_configuration(assay, genome, template_data): colormap: RdYlBu_r """ -def create_config(assay, genome): +def create_config(assay, genome, rerun): env = Environment(loader=FileSystemLoader(template_dir), auto_reload=False) template = env.get_template("config.yaml.jinja") @@ -189,15 +189,20 @@ def create_config(assay, genome): # Setup configuration setup_configuration(assay, genome, template_data) - - # Create directory and render template - dir_name = f"{template_data['project_date']}_{template_data['assay']}_{template_data['project_name']}" - os.makedirs(dir_name, exist_ok=True) - fastq_dir = os.path.join(dir_name, "fastq") - os.makedirs(fastq_dir, exist_ok=True) - with open(os.path.join(dir_name, f"config_{assay}.yml"), 'w') as file: - file.write(template.render(template_data)) + # Create directory and render template + if rerun: + dir_name = os.getcwd() + with open(os.path.join(dir_name, f"config_{assay}.yml"), 'w') as file: + file.write(template.render(template_data)) + else: + dir_name = f"{template_data['project_date']}_{template_data['assay']}_{template_data['project_name']}" + os.makedirs(dir_name, exist_ok=True) + fastq_dir = os.path.join(dir_name, "fastq") + os.makedirs(fastq_dir, exist_ok=True) + + with open(os.path.join(dir_name, f"config_{assay}.yml"), 'w') as file: + file.write(template.render(template_data)) # add deseq2 qmd file if rna if assay == "rna": diff --git a/seqnado/utils.py b/seqnado/utils.py index 88eb5a07..88acabee 100644 --- a/seqnado/utils.py +++ b/seqnado/utils.py @@ -624,6 +624,7 @@ def to_dataframe(self, simplify: bool = True): @classmethod def from_dataframe(cls, df: pd.DataFrame, simplified: bool = True, **kwargs): + experiments = {} for experiment_name, row in df.iterrows(): if simplified: