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

Improve masking of domains overlapping bad bins #36

Merged
merged 6 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,12 @@ jobs:

- name: Test workflow
run: |
printf '%s\t%d\t%d' chr1 0 10000000 > mask.bed

nextflow run -c config/test.config \
--sample="test" \
--hic_file="data/$(basename "$TEST_DATASET_URL")" \
--mask=mask.bed \
--resolution=100000 \
--outdir=data/out \
--max_cpus=$(nproc) \
Expand Down
238 changes: 0 additions & 238 deletions bin/extract_significant_trans_interactions.py

This file was deleted.

75 changes: 0 additions & 75 deletions bin/fill_gaps_between_tads.py

This file was deleted.

8 changes: 7 additions & 1 deletion bin/parse_samplesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def check_is_valid_bed3(path: pathlib.Path, strip_parent_dirs: bool = True):
path = file_uri_basename(str(path))
try:
df = pd.read_table(path, names=["chrom", "start", "end"], usecols=[0, 1, 2])
if len(df) == 0:
return
if df.isnull().values.any():
raise RuntimeError("found one or more null/nan value(s) in one of the first three columns")

Expand Down Expand Up @@ -127,6 +129,10 @@ def main():
if path != "":
check_is_valid_bed3(path)

for path in df["mask"].fillna(""):
if path != "":
check_is_valid_bed3(path)

paths = [uri.partition("::")[0] for uri in df["hic_file"]]

df["hic_file"] = paths
Expand All @@ -135,7 +141,7 @@ def main():


if __name__ == "__main__":
EXPECTED_COLUMNS = tuple(["sample", "hic_file", "resolution", "tads"])
EXPECTED_COLUMNS = tuple(["sample", "hic_file", "resolution", "tads", "mask"])
args = vars(make_cli().parse_args())
sample_sheet = args["tsv"]
detached = args["detached"]
Expand Down
3 changes: 2 additions & 1 deletion bin/plot_maximal_clique_size_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def plot_maximal_clique_sizes(cliques: Dict[str, pd.DataFrame], stat: str) -> pl
)

ax.set_xticks(
range(df["size"].min(), df["size"].max() + 1), labels=range(df["size"].min(), df["size"].max() + 1)
range(df["size"].min(), df["size"].max() + 1),
labels=range(df["size"].min(), df["size"].max() + 1),
)

return fig
Expand Down
3 changes: 2 additions & 1 deletion bin/plot_maximal_clique_sizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def plot_maximal_clique_sizes(cliques: Dict[str, pd.DataFrame], stat: str) -> pl
)

ax.set_xticks(
range(df["size"].min(), df["size"].max() + 1), labels=range(df["size"].min(), df["size"].max() + 1)
range(df["size"].min(), df["size"].max() + 1),
labels=range(df["size"].min(), df["size"].max() + 1),
)

return fig
Expand Down
Loading