biopipen 0.28.0__py3-none-any.whl → 0.29.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of biopipen might be problematic. Click here for more details.

Files changed (83) hide show
  1. biopipen/__init__.py +1 -1
  2. biopipen/core/config.toml +8 -0
  3. biopipen/ns/bam.py +0 -2
  4. biopipen/ns/bed.py +35 -0
  5. biopipen/ns/cellranger_pipeline.py +5 -5
  6. biopipen/ns/cnv.py +18 -2
  7. biopipen/ns/cnvkit_pipeline.py +16 -11
  8. biopipen/ns/gene.py +68 -23
  9. biopipen/ns/misc.py +2 -15
  10. biopipen/ns/plot.py +146 -0
  11. biopipen/ns/regulation.py +214 -0
  12. biopipen/ns/scrna.py +15 -3
  13. biopipen/ns/snp.py +516 -8
  14. biopipen/ns/stats.py +74 -2
  15. biopipen/ns/vcf.py +196 -0
  16. biopipen/reports/snp/PlinkCallRate.svelte +24 -0
  17. biopipen/reports/snp/PlinkFreq.svelte +18 -0
  18. biopipen/reports/snp/PlinkHWE.svelte +18 -0
  19. biopipen/reports/snp/PlinkHet.svelte +18 -0
  20. biopipen/reports/snp/PlinkIBD.svelte +18 -0
  21. biopipen/scripts/bam/CNVpytor.py +144 -46
  22. biopipen/scripts/bed/BedtoolsIntersect.py +54 -0
  23. biopipen/scripts/bed/BedtoolsMerge.py +1 -1
  24. biopipen/scripts/cnv/AneuploidyScore.R +30 -7
  25. biopipen/scripts/cnv/AneuploidyScoreSummary.R +5 -2
  26. biopipen/scripts/cnv/TMADScore.R +21 -5
  27. biopipen/scripts/cnv/TMADScoreSummary.R +6 -2
  28. biopipen/scripts/cnvkit/CNVkitAccess.py +2 -1
  29. biopipen/scripts/cnvkit/CNVkitAutobin.py +3 -2
  30. biopipen/scripts/cnvkit/CNVkitBatch.py +1 -1
  31. biopipen/scripts/cnvkit/CNVkitCoverage.py +2 -1
  32. biopipen/scripts/cnvkit/CNVkitGuessBaits.py +1 -1
  33. biopipen/scripts/cnvkit/CNVkitHeatmap.py +1 -1
  34. biopipen/scripts/cnvkit/CNVkitReference.py +2 -1
  35. biopipen/scripts/gene/GeneNameConversion.R +65 -0
  36. biopipen/scripts/gene/GenePromoters.R +61 -0
  37. biopipen/scripts/misc/Shell.sh +15 -0
  38. biopipen/scripts/plot/Manhattan.R +140 -0
  39. biopipen/scripts/plot/QQPlot.R +62 -0
  40. biopipen/scripts/regulation/MotifAffinityTest.R +226 -0
  41. biopipen/scripts/regulation/MotifAffinityTest_AtSNP.R +126 -0
  42. biopipen/scripts/regulation/MotifAffinityTest_MotifBreakR.R +96 -0
  43. biopipen/scripts/regulation/MotifScan.py +159 -0
  44. biopipen/scripts/regulation/atSNP.R +33 -0
  45. biopipen/scripts/regulation/motifBreakR.R +1594 -0
  46. biopipen/scripts/scrna/CellsDistribution.R +2 -0
  47. biopipen/scripts/scrna/MarkersFinder.R +59 -67
  48. biopipen/scripts/scrna/SeuratClustering.R +63 -29
  49. biopipen/scripts/scrna/SeuratMap2Ref.R +20 -0
  50. biopipen/scripts/scrna/SeuratSubClustering.R +76 -27
  51. biopipen/scripts/snp/MatrixEQTL.R +84 -43
  52. biopipen/scripts/snp/Plink2GTMat.py +133 -0
  53. biopipen/scripts/snp/PlinkCallRate.R +190 -0
  54. biopipen/scripts/snp/PlinkFilter.py +100 -0
  55. biopipen/scripts/snp/PlinkFreq.R +298 -0
  56. biopipen/scripts/snp/PlinkFromVcf.py +78 -0
  57. biopipen/scripts/snp/PlinkHWE.R +80 -0
  58. biopipen/scripts/snp/PlinkHet.R +92 -0
  59. biopipen/scripts/snp/PlinkIBD.R +197 -0
  60. biopipen/scripts/snp/PlinkUpdateName.py +124 -0
  61. biopipen/scripts/stats/MetaPvalue.R +2 -1
  62. biopipen/scripts/stats/MetaPvalue1.R +70 -0
  63. biopipen/scripts/tcr/TCRClusterStats.R +12 -7
  64. biopipen/scripts/vcf/BcftoolsAnnotate.py +91 -0
  65. biopipen/scripts/vcf/BcftoolsFilter.py +90 -0
  66. biopipen/scripts/vcf/BcftoolsSort.py +113 -0
  67. biopipen/scripts/vcf/BcftoolsView.py +73 -0
  68. biopipen/scripts/vcf/VcfFix_utils.py +1 -1
  69. biopipen/scripts/vcf/bcftools_utils.py +52 -0
  70. biopipen/utils/gene.R +83 -37
  71. biopipen/utils/gene.py +108 -60
  72. biopipen/utils/misc.R +56 -0
  73. biopipen/utils/misc.py +5 -2
  74. biopipen/utils/reference.py +54 -10
  75. {biopipen-0.28.0.dist-info → biopipen-0.29.0.dist-info}/METADATA +2 -2
  76. {biopipen-0.28.0.dist-info → biopipen-0.29.0.dist-info}/RECORD +78 -50
  77. {biopipen-0.28.0.dist-info → biopipen-0.29.0.dist-info}/entry_points.txt +1 -1
  78. biopipen/ns/bcftools.py +0 -111
  79. biopipen/scripts/bcftools/BcftoolsAnnotate.py +0 -42
  80. biopipen/scripts/bcftools/BcftoolsFilter.py +0 -79
  81. biopipen/scripts/bcftools/BcftoolsSort.py +0 -19
  82. biopipen/scripts/gene/GeneNameConversion.py +0 -66
  83. {biopipen-0.28.0.dist-info → biopipen-0.29.0.dist-info}/WHEEL +0 -0
@@ -1,19 +0,0 @@
1
- from biopipen.utils.misc import run_command, dict_to_cli_args
2
-
3
- infile = {{in.infile | quote}} # pyright: ignore
4
- outfile = {{out.outfile | quote}} # pyright: ignore
5
- bcftools = {{envs.bcftools | quote}} # pyright: ignore
6
- gz = {{envs.gz | repr}} # pyright: ignore
7
- args = {{envs.args | repr}} # pyright: ignore
8
- tmpdir = {{envs.tmpdir | quote}} # pyright: ignore
9
- index = {{envs.index | repr}} # pyright: ignore
10
-
11
- args[""] = bcftools
12
- args["_"] = infile
13
- args["o"] = outfile
14
- args["O"] = "z" if gz or index else "v"
15
-
16
- run_command(dict_to_cli_args(args, dashify=True), fg=True)
17
-
18
- if index:
19
- run_command([bcftools, "index", outfile], fg=True)
@@ -1,66 +0,0 @@
1
- import pandas
2
- from datar.all import c, right_join, select, relocate
3
- from biopipen.utils.gene import gene_name_conversion
4
-
5
- infile = {{in.infile | quote}} # pyright: ignore
6
- outfile = {{out.outfile | quote}} # pyright: ignore
7
- inopts = {{envs.inopts | repr}} # pyright: ignore
8
- outopts = {{envs.outopts | repr}} # pyright: ignore
9
- notfound = {{envs.notfound | repr}} # pyright: ignore
10
- genecol = {{envs.genecol | repr}} # pyright: ignore
11
- output = {{envs.output | repr}} # pyright: ignore
12
- infmt = {{envs.infmt | repr}} # pyright: ignore
13
- outfmt = {{envs.outfmt | repr}} # pyright: ignore
14
- species = {{envs.species | quote}} # pyright: ignore
15
-
16
- df = pandas.read_csv(infile, **inopts)
17
-
18
- if isinstance(genecol, int):
19
- genes = df.iloc[:, genecol]
20
- else:
21
- genes = df.loc[:, genecol]
22
-
23
- colname = genes.name
24
- genes = genes.tolist()
25
-
26
- # query `outfmt`
27
- # <object> <object>
28
- # 0 1255_g_at GUCA1A
29
- # 1 1316_at THRA
30
- # 2 1320_at PTPN21
31
- # 3 1294_at MIR5193
32
- converted = gene_name_conversion(
33
- genes=genes,
34
- species=species,
35
- infmt=infmt,
36
- outfmt=outfmt,
37
- notfound=notfound,
38
- )
39
- converted.columns = [colname] + converted.columns[1:].tolist()
40
-
41
- if output == "only":
42
- out = converted
43
-
44
- elif output == "keep":
45
- out = df >> right_join(converted, by=colname, suffix=["", "_converted"])
46
-
47
- elif output == "drop":
48
- out = df >> right_join(
49
- converted,
50
- by=colname, suffix=["", "_converted"]
51
- ) >> select(~c(colname))
52
-
53
- elif output == "replace":
54
- out = df >> right_join(
55
- converted, by=colname, suffix=["", "_converted"]
56
- )
57
- converted_cols = out.columns[-len(converted.columns)+1:].tolist()
58
- pos = df.columns.get_indexer([colname])[0]
59
- out = out >> relocate(
60
- converted_cols, _after=pos+1
61
- ) >> select(~c(colname))
62
-
63
- else:
64
- raise ValueError(f"Unknown output mode: {output}.")
65
-
66
- out.to_csv(outfile, **outopts)