Skip to content

Commit

Permalink
Merge branch 'develop' into feat-handle-failed-peak-calls
Browse files Browse the repository at this point in the history
  • Loading branch information
alsmith151 authored Feb 5, 2024
2 parents 5ebfd2f + 4407145 commit f5ff90a
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
14 changes: 14 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions docs/pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions seqnado/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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()
Expand Down
23 changes: 14 additions & 9 deletions seqnado/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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":
Expand Down
1 change: 1 addition & 0 deletions seqnado/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f5ff90a

Please sign in to comment.