biopipen 0.27.9__tar.gz → 1.1.4__tar.gz

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.
Files changed (379) hide show
  1. biopipen-1.1.4/PKG-INFO +27 -0
  2. biopipen-1.1.4/biopipen/__init__.py +1 -0
  3. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/core/config.toml +20 -0
  4. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/core/filters.py +36 -138
  5. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/core/proc.py +5 -3
  6. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/core/testing.py +16 -3
  7. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/ns/bam.py +148 -6
  8. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/ns/bed.py +75 -0
  9. biopipen-1.1.4/biopipen/ns/cellranger.py +186 -0
  10. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/ns/cellranger_pipeline.py +39 -8
  11. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/ns/cnv.py +19 -3
  12. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/ns/cnvkit.py +1 -1
  13. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/ns/cnvkit_pipeline.py +20 -12
  14. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/ns/delim.py +34 -28
  15. biopipen-1.1.4/biopipen/ns/gene.py +99 -0
  16. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/ns/gsea.py +63 -37
  17. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/ns/misc.py +39 -14
  18. biopipen-1.1.4/biopipen/ns/plot.py +419 -0
  19. biopipen-1.1.4/biopipen/ns/protein.py +183 -0
  20. biopipen-1.1.4/biopipen/ns/regulatory.py +290 -0
  21. biopipen-1.1.4/biopipen/ns/scrna.py +3444 -0
  22. biopipen-1.1.4/biopipen/ns/scrna_metabolic_landscape.py +517 -0
  23. biopipen-1.1.4/biopipen/ns/snp.py +659 -0
  24. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/ns/stats.py +167 -3
  25. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/ns/tcr.py +522 -82
  26. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/ns/vcf.py +236 -2
  27. biopipen-1.1.4/biopipen/ns/web.py +169 -0
  28. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/bam/CNVpytor.svelte +4 -9
  29. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/cnvkit/CNVkitDiagram.svelte +1 -1
  30. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/cnvkit/CNVkitHeatmap.svelte +1 -1
  31. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/cnvkit/CNVkitScatter.svelte +1 -1
  32. biopipen-1.1.4/biopipen/reports/common.svelte +15 -0
  33. biopipen-0.27.9/biopipen/reports/scrna/SeuratPreparing.svelte → biopipen-1.1.4/biopipen/reports/protein/ProdigySummary.svelte +3 -2
  34. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/scrna/DimPlots.svelte +1 -1
  35. biopipen-1.1.4/biopipen/reports/scrna/MQuad.svelte +72 -0
  36. biopipen-1.1.4/biopipen/reports/scrna/VireoSNP.svelte +47 -0
  37. biopipen-1.1.4/biopipen/reports/scrna_metabolic_landscape/MetabolicFeatures.svelte +70 -0
  38. biopipen-1.1.4/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayActivity.svelte +103 -0
  39. biopipen-1.1.4/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.svelte +81 -0
  40. biopipen-1.1.4/biopipen/reports/snp/PlinkCallRate.svelte +24 -0
  41. biopipen-1.1.4/biopipen/reports/snp/PlinkFreq.svelte +18 -0
  42. biopipen-1.1.4/biopipen/reports/snp/PlinkHWE.svelte +18 -0
  43. biopipen-1.1.4/biopipen/reports/snp/PlinkHet.svelte +18 -0
  44. biopipen-1.1.4/biopipen/reports/snp/PlinkIBD.svelte +18 -0
  45. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/tcr/CDR3AAPhyschem.svelte +1 -1
  46. biopipen-0.27.9/biopipen/reports/delim/SampleInfo.svelte → biopipen-1.1.4/biopipen/reports/tcr/ClonalStats.svelte +2 -2
  47. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/utils/misc.liq +22 -7
  48. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/bam/BamMerge.py +11 -15
  49. biopipen-1.1.4/biopipen/scripts/bam/BamSampling.py +90 -0
  50. biopipen-1.1.4/biopipen/scripts/bam/BamSort.py +141 -0
  51. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/bam/BamSplitChroms.py +10 -10
  52. biopipen-1.1.4/biopipen/scripts/bam/BamSubsetByBed.py +38 -0
  53. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/bam/CNAClinic.R +41 -5
  54. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/bam/CNVpytor.py +153 -54
  55. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/bam/ControlFREEC.py +13 -14
  56. biopipen-1.1.4/biopipen/scripts/bam/SamtoolsView.py +33 -0
  57. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/bed/Bed2Vcf.py +5 -5
  58. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/bed/BedConsensus.py +6 -4
  59. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/bed/BedLiftOver.sh +6 -4
  60. biopipen-1.1.4/biopipen/scripts/bed/BedtoolsIntersect.py +54 -0
  61. biopipen-1.1.4/biopipen/scripts/bed/BedtoolsMakeWindows.py +47 -0
  62. biopipen-1.1.4/biopipen/scripts/bed/BedtoolsMerge.py +11 -0
  63. biopipen-1.1.4/biopipen/scripts/cellranger/CellRangerCount.py +139 -0
  64. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/cellranger/CellRangerSummary.R +20 -28
  65. biopipen-1.1.4/biopipen/scripts/cellranger/CellRangerVdj.py +113 -0
  66. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/cnv/AneuploidyScore.R +55 -20
  67. biopipen-1.1.4/biopipen/scripts/cnv/AneuploidyScoreSummary.R +397 -0
  68. biopipen-1.1.4/biopipen/scripts/cnv/TMADScore.R +51 -0
  69. biopipen-1.1.4/biopipen/scripts/cnv/TMADScoreSummary.R +164 -0
  70. biopipen-1.1.4/biopipen/scripts/cnvkit/CNVkitAccess.py +26 -0
  71. biopipen-1.1.4/biopipen/scripts/cnvkit/CNVkitAutobin.py +53 -0
  72. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/cnvkit/CNVkitBatch.py +6 -6
  73. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/cnvkit/CNVkitCall.py +3 -3
  74. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/cnvkit/CNVkitCoverage.py +4 -3
  75. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/cnvkit/CNVkitDiagram.py +5 -5
  76. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/cnvkit/CNVkitFix.py +3 -3
  77. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/cnvkit/CNVkitGuessBaits.py +13 -8
  78. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/cnvkit/CNVkitHeatmap.py +5 -5
  79. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/cnvkit/CNVkitReference.py +6 -5
  80. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/cnvkit/CNVkitScatter.py +5 -5
  81. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/cnvkit/CNVkitSegment.py +5 -5
  82. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/cnvkit/guess_baits.py +166 -93
  83. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/delim/RowsBinder.R +1 -1
  84. biopipen-1.1.4/biopipen/scripts/delim/SampleInfo.R +160 -0
  85. biopipen-1.1.4/biopipen/scripts/gene/GeneNameConversion.R +67 -0
  86. biopipen-1.1.4/biopipen/scripts/gene/GenePromoters.R +61 -0
  87. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/gsea/Enrichr.R +5 -5
  88. biopipen-1.1.4/biopipen/scripts/gsea/FGSEA.R +192 -0
  89. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/gsea/GSEA.R +2 -2
  90. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/gsea/PreRank.R +5 -5
  91. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/misc/Config2File.py +2 -2
  92. biopipen-1.1.4/biopipen/scripts/misc/Plot.R +80 -0
  93. biopipen-1.1.4/biopipen/scripts/misc/Shell.sh +15 -0
  94. biopipen-1.1.4/biopipen/scripts/misc/Str2File.py +6 -0
  95. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/plot/Heatmap.R +3 -3
  96. biopipen-1.1.4/biopipen/scripts/plot/Manhattan.R +147 -0
  97. biopipen-1.1.4/biopipen/scripts/plot/QQPlot.R +146 -0
  98. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/plot/ROC.R +1 -1
  99. biopipen-1.1.4/biopipen/scripts/plot/Scatter.R +112 -0
  100. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/plot/VennDiagram.R +5 -9
  101. biopipen-1.1.4/biopipen/scripts/protein/MMCIF2PDB.py +33 -0
  102. biopipen-1.1.4/biopipen/scripts/protein/PDB2Fasta.py +60 -0
  103. biopipen-1.1.4/biopipen/scripts/protein/Prodigy.py +119 -0
  104. biopipen-1.1.4/biopipen/scripts/protein/ProdigySummary.R +140 -0
  105. biopipen-1.1.4/biopipen/scripts/protein/RMSD.py +178 -0
  106. biopipen-1.1.4/biopipen/scripts/regulatory/MotifAffinityTest.R +102 -0
  107. biopipen-1.1.4/biopipen/scripts/regulatory/MotifAffinityTest_AtSNP.R +127 -0
  108. biopipen-1.1.4/biopipen/scripts/regulatory/MotifAffinityTest_MotifBreakR.R +104 -0
  109. biopipen-1.1.4/biopipen/scripts/regulatory/MotifScan.py +159 -0
  110. biopipen-1.1.4/biopipen/scripts/regulatory/VariantMotifPlot.R +78 -0
  111. biopipen-1.1.4/biopipen/scripts/regulatory/motifs-common.R +324 -0
  112. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/rnaseq/Simulation-ESCO.R +14 -11
  113. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/rnaseq/Simulation-RUVcorr.R +7 -4
  114. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/rnaseq/Simulation.R +0 -2
  115. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/rnaseq/UnitConversion.R +6 -4
  116. biopipen-1.1.4/biopipen/scripts/scrna/AnnData2Seurat.R +44 -0
  117. biopipen-1.1.4/biopipen/scripts/scrna/CCPlotR-patch.R +161 -0
  118. biopipen-1.1.4/biopipen/scripts/scrna/CellCellCommunication.py +150 -0
  119. biopipen-1.1.4/biopipen/scripts/scrna/CellCellCommunicationPlots.R +93 -0
  120. biopipen-1.1.4/biopipen/scripts/scrna/CellSNPLite.py +253 -0
  121. biopipen-1.1.4/biopipen/scripts/scrna/CellTypeAnnotation-celltypist.R +234 -0
  122. biopipen-1.1.4/biopipen/scripts/scrna/CellTypeAnnotation-direct.R +69 -0
  123. biopipen-1.1.4/biopipen/scripts/scrna/CellTypeAnnotation-hitype.R +59 -0
  124. biopipen-1.1.4/biopipen/scripts/scrna/CellTypeAnnotation-sccatch.R +53 -0
  125. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/CellTypeAnnotation-sctype.R +29 -33
  126. biopipen-1.1.4/biopipen/scripts/scrna/CellTypeAnnotation.R +59 -0
  127. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/CellsDistribution.R +38 -10
  128. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/DimPlots.R +1 -1
  129. biopipen-1.1.4/biopipen/scripts/scrna/ExprImputation-alra.R +109 -0
  130. biopipen-1.1.4/biopipen/scripts/scrna/ExprImputation-rmagic.R +256 -0
  131. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/ExprImputation-scimpute.R +8 -5
  132. biopipen-1.1.4/biopipen/scripts/scrna/LoomTo10X.R +51 -0
  133. biopipen-1.1.4/biopipen/scripts/scrna/MQuad.py +57 -0
  134. biopipen-1.1.4/biopipen/scripts/scrna/MQuadMerge.py +106 -0
  135. biopipen-1.1.4/biopipen/scripts/scrna/MarkersFinder.R +748 -0
  136. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/MetaMarkers.R +41 -14
  137. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/ModuleScoreCalculator.R +23 -13
  138. biopipen-1.1.4/biopipen/scripts/scrna/PseudoBulkDEG.R +679 -0
  139. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/RadarPlots.R +77 -37
  140. biopipen-1.1.4/biopipen/scripts/scrna/ScFGSEA.R +346 -0
  141. biopipen-1.1.4/biopipen/scripts/scrna/ScSimulation.R +65 -0
  142. biopipen-1.1.4/biopipen/scripts/scrna/ScVelo.py +617 -0
  143. biopipen-1.1.4/biopipen/scripts/scrna/Seurat2AnnData.R +7 -0
  144. biopipen-1.1.4/biopipen/scripts/scrna/SeuratClusterStats-clustree.R +87 -0
  145. biopipen-1.1.4/biopipen/scripts/scrna/SeuratClusterStats-dimplots.R +50 -0
  146. biopipen-1.1.4/biopipen/scripts/scrna/SeuratClusterStats-features.R +188 -0
  147. biopipen-1.1.4/biopipen/scripts/scrna/SeuratClusterStats-ngenes.R +81 -0
  148. biopipen-1.1.4/biopipen/scripts/scrna/SeuratClusterStats-stats.R +97 -0
  149. biopipen-1.1.4/biopipen/scripts/scrna/SeuratClusterStats.R +58 -0
  150. biopipen-1.1.4/biopipen/scripts/scrna/SeuratClustering.R +43 -0
  151. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/SeuratLoading.R +2 -2
  152. biopipen-1.1.4/biopipen/scripts/scrna/SeuratMap2Ref.R +110 -0
  153. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/SeuratMetadataMutater.R +12 -7
  154. biopipen-1.1.4/biopipen/scripts/scrna/SeuratPreparing.R +259 -0
  155. biopipen-1.1.4/biopipen/scripts/scrna/SeuratSubClustering.R +64 -0
  156. biopipen-1.1.4/biopipen/scripts/scrna/Slingshot.R +65 -0
  157. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/Subset10X.R +2 -2
  158. biopipen-1.1.4/biopipen/scripts/scrna/TopExpressingGenes.R +209 -0
  159. biopipen-1.1.4/biopipen/scripts/scrna/VireoSNP.py +401 -0
  160. biopipen-1.1.4/biopipen/scripts/scrna/celltypist-wrapper.py +195 -0
  161. biopipen-1.1.4/biopipen/scripts/scrna/mquad_cli.py +501 -0
  162. biopipen-1.1.4/biopipen/scripts/scrna/scvelo_paga.py +313 -0
  163. biopipen-1.1.4/biopipen/scripts/scrna/seurat_anndata_conversion.py +98 -0
  164. biopipen-1.1.4/biopipen/scripts/scrna_metabolic_landscape/MetabolicFeatures.R +477 -0
  165. biopipen-1.1.4/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayActivity.R +498 -0
  166. biopipen-1.1.4/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.R +264 -0
  167. biopipen-1.1.4/biopipen/scripts/snp/MatrixEQTL.R +217 -0
  168. biopipen-1.1.4/biopipen/scripts/snp/Plink2GTMat.py +148 -0
  169. biopipen-1.1.4/biopipen/scripts/snp/PlinkCallRate.R +199 -0
  170. biopipen-1.1.4/biopipen/scripts/snp/PlinkFilter.py +100 -0
  171. biopipen-1.1.4/biopipen/scripts/snp/PlinkFreq.R +291 -0
  172. biopipen-1.1.4/biopipen/scripts/snp/PlinkFromVcf.py +81 -0
  173. biopipen-1.1.4/biopipen/scripts/snp/PlinkHWE.R +85 -0
  174. biopipen-1.1.4/biopipen/scripts/snp/PlinkHet.R +96 -0
  175. biopipen-1.1.4/biopipen/scripts/snp/PlinkIBD.R +196 -0
  176. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/snp/PlinkSimulation.py +4 -4
  177. biopipen-1.1.4/biopipen/scripts/snp/PlinkUpdateName.py +124 -0
  178. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/stats/ChowTest.R +57 -30
  179. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/stats/DiffCoexpr.R +13 -11
  180. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/stats/LiquidAssoc.R +7 -8
  181. biopipen-1.1.4/biopipen/scripts/stats/Mediation.R +108 -0
  182. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/stats/MetaPvalue.R +16 -14
  183. biopipen-1.1.4/biopipen/scripts/stats/MetaPvalue1.R +74 -0
  184. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcgamaf/Maf2Vcf.py +2 -2
  185. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcgamaf/MafAddChr.py +2 -2
  186. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/Attach2Seurat.R +1 -1
  187. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/CDR3AAPhyschem.R +109 -153
  188. biopipen-1.1.4/biopipen/scripts/tcr/CDR3Clustering.R +344 -0
  189. biopipen-1.1.4/biopipen/scripts/tcr/ClonalStats.R +526 -0
  190. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/CloneResidency.R +28 -10
  191. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/CloneSizeQQPlot.R +4 -4
  192. biopipen-1.1.4/biopipen/scripts/tcr/GIANA/GIANA.py +1817 -0
  193. biopipen-1.1.4/biopipen/scripts/tcr/GIANA/GIANA4.py +1781 -0
  194. biopipen-1.1.4/biopipen/scripts/tcr/GIANA/query.py +226 -0
  195. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/Immunarch-basic.R +8 -5
  196. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/Immunarch-clonality.R +5 -4
  197. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/Immunarch-diversity.R +27 -28
  198. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/Immunarch-geneusage.R +15 -3
  199. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/Immunarch-kmer.R +14 -3
  200. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/Immunarch-overlap.R +15 -3
  201. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/Immunarch-spectratyping.R +10 -3
  202. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/Immunarch-tracking.R +6 -2
  203. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/Immunarch-vjjunc.R +33 -2
  204. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/Immunarch.R +43 -11
  205. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/Immunarch2VDJtools.R +2 -2
  206. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/ImmunarchFilter.R +4 -4
  207. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/ImmunarchLoading.R +7 -7
  208. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/SampleDiversity.R +1 -1
  209. biopipen-1.1.4/biopipen/scripts/tcr/ScRepCombiningExpression.R +40 -0
  210. biopipen-1.1.4/biopipen/scripts/tcr/ScRepLoading.R +166 -0
  211. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/TCRClusterStats.R +40 -18
  212. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/TCRDock.py +10 -6
  213. biopipen-1.1.4/biopipen/scripts/tcr/TESSA.R +187 -0
  214. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/TESSA_source/BriseisEncoder.py +52 -3
  215. biopipen-1.1.4/biopipen/scripts/tcr/TESSA_source/KERAS_MIGRATION.md +106 -0
  216. biopipen-1.1.4/biopipen/scripts/tcr/TESSA_source/migrate_keras_model.py +124 -0
  217. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/VJUsage.R +5 -5
  218. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/vdjtools-patch.sh +1 -1
  219. biopipen-1.1.4/biopipen/scripts/vcf/BcftoolsAnnotate.py +91 -0
  220. biopipen-1.1.4/biopipen/scripts/vcf/BcftoolsFilter.py +90 -0
  221. biopipen-1.1.4/biopipen/scripts/vcf/BcftoolsMerge.py +32 -0
  222. biopipen-1.1.4/biopipen/scripts/vcf/BcftoolsSort.py +113 -0
  223. biopipen-1.1.4/biopipen/scripts/vcf/BcftoolsView.py +73 -0
  224. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/vcf/TruvariBench.sh +14 -7
  225. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/vcf/TruvariBenchSummary.R +16 -13
  226. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/vcf/TruvariConsistency.R +1 -1
  227. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/vcf/Vcf2Bed.py +2 -2
  228. biopipen-1.1.4/biopipen/scripts/vcf/VcfAnno.py +26 -0
  229. biopipen-1.1.4/biopipen/scripts/vcf/VcfDownSample.sh +37 -0
  230. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/vcf/VcfFilter.py +5 -5
  231. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/vcf/VcfFix.py +7 -7
  232. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/vcf/VcfFix_utils.py +13 -4
  233. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/vcf/VcfIndex.py +3 -3
  234. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/vcf/VcfIntersect.py +3 -3
  235. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/vcf/VcfLiftOver.sh +5 -0
  236. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/vcf/VcfSplitSamples.py +4 -4
  237. biopipen-1.1.4/biopipen/scripts/vcf/bcftools_utils.py +52 -0
  238. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/web/Download.py +8 -4
  239. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/web/DownloadList.py +5 -5
  240. biopipen-1.1.4/biopipen/scripts/web/GCloudStorageDownloadBucket.py +82 -0
  241. biopipen-1.1.4/biopipen/scripts/web/GCloudStorageDownloadFile.py +23 -0
  242. biopipen-1.1.4/biopipen/scripts/web/gcloud_common.py +49 -0
  243. biopipen-1.1.4/biopipen/utils/gene.py +134 -0
  244. biopipen-1.1.4/biopipen/utils/misc.py +254 -0
  245. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/utils/reference.py +64 -20
  246. biopipen-1.1.4/biopipen/utils/reporter.py +177 -0
  247. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/utils/vcf.py +1 -1
  248. {biopipen-0.27.9 → biopipen-1.1.4}/pyproject.toml +20 -13
  249. {biopipen-0.27.9 → biopipen-1.1.4}/setup.py +19 -13
  250. biopipen-0.27.9/PKG-INFO +0 -22
  251. biopipen-0.27.9/biopipen/__init__.py +0 -1
  252. biopipen-0.27.9/biopipen/ns/bcftools.py +0 -111
  253. biopipen-0.27.9/biopipen/ns/cellranger.py +0 -132
  254. biopipen-0.27.9/biopipen/ns/gene.py +0 -54
  255. biopipen-0.27.9/biopipen/ns/plot.py +0 -152
  256. biopipen-0.27.9/biopipen/ns/scrna.py +0 -2195
  257. biopipen-0.27.9/biopipen/ns/scrna_metabolic_landscape.py +0 -670
  258. biopipen-0.27.9/biopipen/ns/snp.py +0 -138
  259. biopipen-0.27.9/biopipen/ns/web.py +0 -78
  260. biopipen-0.27.9/biopipen/reports/scrna/ScFGSEA.svelte +0 -16
  261. biopipen-0.27.9/biopipen/reports/scrna/SeuratClusterStats.svelte +0 -16
  262. biopipen-0.27.9/biopipen/reports/scrna/SeuratMap2Ref.svelte +0 -20
  263. biopipen-0.27.9/biopipen/reports/scrna/TopExpressingGenes.svelte +0 -17
  264. biopipen-0.27.9/biopipen/reports/scrna_metabolic_landscape/MetabolicFeatures.svelte +0 -32
  265. biopipen-0.27.9/biopipen/reports/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.svelte +0 -28
  266. biopipen-0.27.9/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayActivity.svelte +0 -89
  267. biopipen-0.27.9/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.svelte +0 -15
  268. biopipen-0.27.9/biopipen/reports/utils/gsea.liq +0 -110
  269. biopipen-0.27.9/biopipen/scripts/bcftools/BcftoolsAnnotate.py +0 -42
  270. biopipen-0.27.9/biopipen/scripts/bcftools/BcftoolsFilter.py +0 -79
  271. biopipen-0.27.9/biopipen/scripts/bcftools/BcftoolsSort.py +0 -19
  272. biopipen-0.27.9/biopipen/scripts/bed/BedtoolsMerge.py +0 -11
  273. biopipen-0.27.9/biopipen/scripts/cellranger/CellRangerCount.py +0 -79
  274. biopipen-0.27.9/biopipen/scripts/cellranger/CellRangerVdj.py +0 -79
  275. biopipen-0.27.9/biopipen/scripts/cnv/AneuploidyScoreSummary.R +0 -339
  276. biopipen-0.27.9/biopipen/scripts/cnv/TMADScore.R +0 -35
  277. biopipen-0.27.9/biopipen/scripts/cnv/TMADScoreSummary.R +0 -193
  278. biopipen-0.27.9/biopipen/scripts/cnvkit/CNVkitAccess.py +0 -24
  279. biopipen-0.27.9/biopipen/scripts/cnvkit/CNVkitAutobin.py +0 -44
  280. biopipen-0.27.9/biopipen/scripts/delim/SampleInfo.R +0 -196
  281. biopipen-0.27.9/biopipen/scripts/gene/GeneNameConversion.py +0 -66
  282. biopipen-0.27.9/biopipen/scripts/gsea/FGSEA.R +0 -58
  283. biopipen-0.27.9/biopipen/scripts/misc/Str2File.py +0 -6
  284. biopipen-0.27.9/biopipen/scripts/scrna/AnnData2Seurat.R +0 -79
  285. biopipen-0.27.9/biopipen/scripts/scrna/CellTypeAnnotation-celltypist.R +0 -236
  286. biopipen-0.27.9/biopipen/scripts/scrna/CellTypeAnnotation-direct.R +0 -59
  287. biopipen-0.27.9/biopipen/scripts/scrna/CellTypeAnnotation-hitype.R +0 -69
  288. biopipen-0.27.9/biopipen/scripts/scrna/CellTypeAnnotation-sccatch.R +0 -58
  289. biopipen-0.27.9/biopipen/scripts/scrna/CellTypeAnnotation.R +0 -15
  290. biopipen-0.27.9/biopipen/scripts/scrna/ExprImputation-alra.R +0 -33
  291. biopipen-0.27.9/biopipen/scripts/scrna/ExprImputation-rmagic.R +0 -30
  292. biopipen-0.27.9/biopipen/scripts/scrna/MarkersFinder.R +0 -703
  293. biopipen-0.27.9/biopipen/scripts/scrna/ScFGSEA.R +0 -193
  294. biopipen-0.27.9/biopipen/scripts/scrna/Seurat2AnnData.R +0 -48
  295. biopipen-0.27.9/biopipen/scripts/scrna/SeuratClusterStats-dimplots.R +0 -70
  296. biopipen-0.27.9/biopipen/scripts/scrna/SeuratClusterStats-features.R +0 -444
  297. biopipen-0.27.9/biopipen/scripts/scrna/SeuratClusterStats-hists.R +0 -138
  298. biopipen-0.27.9/biopipen/scripts/scrna/SeuratClusterStats-ngenes.R +0 -69
  299. biopipen-0.27.9/biopipen/scripts/scrna/SeuratClusterStats-stats.R +0 -257
  300. biopipen-0.27.9/biopipen/scripts/scrna/SeuratClusterStats.R +0 -44
  301. biopipen-0.27.9/biopipen/scripts/scrna/SeuratClustering.R +0 -174
  302. biopipen-0.27.9/biopipen/scripts/scrna/SeuratMap2Ref.R +0 -302
  303. biopipen-0.27.9/biopipen/scripts/scrna/SeuratPreparing.R +0 -552
  304. biopipen-0.27.9/biopipen/scripts/scrna/SeuratSubClustering.R +0 -169
  305. biopipen-0.27.9/biopipen/scripts/scrna/TopExpressingGenes.R +0 -251
  306. biopipen-0.27.9/biopipen/scripts/scrna/celltypist-wrapper.py +0 -54
  307. biopipen-0.27.9/biopipen/scripts/scrna_metabolic_landscape/MetabolicFeatures.R +0 -162
  308. biopipen-0.27.9/biopipen/scripts/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.R +0 -189
  309. biopipen-0.27.9/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayActivity.R +0 -397
  310. biopipen-0.27.9/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.R +0 -254
  311. biopipen-0.27.9/biopipen/scripts/snp/MatrixEQTL.R +0 -157
  312. biopipen-0.27.9/biopipen/scripts/tcr/GIANA/GIANA.py +0 -1258
  313. biopipen-0.27.9/biopipen/scripts/tcr/GIANA/GIANA4.py +0 -1208
  314. biopipen-0.27.9/biopipen/scripts/tcr/GIANA/query.py +0 -224
  315. biopipen-0.27.9/biopipen/scripts/tcr/TCRClustering.R +0 -298
  316. biopipen-0.27.9/biopipen/scripts/tcr/TESSA.R +0 -230
  317. biopipen-0.27.9/biopipen/scripts/vcf/VcfAnno.py +0 -26
  318. biopipen-0.27.9/biopipen/scripts/vcf/VcfDownSample.sh +0 -25
  319. biopipen-0.27.9/biopipen/utils/caching.R +0 -44
  320. biopipen-0.27.9/biopipen/utils/common_docstrs.py +0 -100
  321. biopipen-0.27.9/biopipen/utils/gene.R +0 -49
  322. biopipen-0.27.9/biopipen/utils/gene.py +0 -86
  323. biopipen-0.27.9/biopipen/utils/gsea.R +0 -275
  324. biopipen-0.27.9/biopipen/utils/io.R +0 -20
  325. biopipen-0.27.9/biopipen/utils/misc.R +0 -348
  326. biopipen-0.27.9/biopipen/utils/misc.py +0 -122
  327. biopipen-0.27.9/biopipen/utils/mutate_helpers.R +0 -581
  328. biopipen-0.27.9/biopipen/utils/plot.R +0 -173
  329. biopipen-0.27.9/biopipen/utils/rnaseq.R +0 -48
  330. biopipen-0.27.9/biopipen/utils/single_cell.R +0 -116
  331. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/core/__init__.py +0 -0
  332. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/core/config.py +0 -0
  333. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/core/defaults.py +0 -0
  334. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/ns/__init__.py +0 -0
  335. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/ns/rnaseq.py +0 -0
  336. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/ns/tcgamaf.py +0 -0
  337. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/bam/CNAClinic.svelte +0 -0
  338. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/bam/ControlFREEC.svelte +0 -0
  339. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/cellranger/CellRangerCount.svelte +0 -0
  340. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/cellranger/CellRangerSummary.svelte +0 -0
  341. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/cellranger/CellRangerVdj.svelte +0 -0
  342. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/cnv/AneuploidyScore.svelte +0 -0
  343. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/cnv/AneuploidyScoreSummary.svelte +0 -0
  344. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/cnv/TMADScoreSummary.svelte +0 -0
  345. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/gsea/FGSEA.svelte +0 -0
  346. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/gsea/GSEA.svelte +0 -0
  347. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/scrna/CellsDistribution.svelte +0 -0
  348. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/scrna/MarkersFinder.svelte +0 -0
  349. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/scrna/MetaMarkers.svelte +0 -0
  350. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/scrna/RadarPlots.svelte +0 -0
  351. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/tcr/CloneResidency.svelte +0 -0
  352. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/tcr/Immunarch.svelte +0 -0
  353. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/tcr/SampleDiversity.svelte +0 -0
  354. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/tcr/TCRClusterStats.svelte +0 -0
  355. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/tcr/TESSA.svelte +0 -0
  356. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/tcr/VJUsage.svelte +0 -0
  357. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/vcf/TruvariBenchSummary.svelte +0 -0
  358. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/reports/vcf/TruvariConsistency.svelte +0 -0
  359. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/ExprImputation.R +0 -0
  360. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/SCImpute.R +0 -0
  361. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/SeuratFilter.R +0 -0
  362. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/SeuratSplit.R +0 -0
  363. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/SeuratSubset.R +0 -0
  364. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/SeuratTo10X.R +0 -0
  365. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/scrna/sctype.R +0 -0
  366. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcgamaf/maf2vcf.pl +0 -0
  367. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/GIANA/Imgt_Human_TRBV.fasta +0 -0
  368. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/ImmunarchSplitIdents.R +0 -0
  369. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/TESSA_source/Atchley_factors.csv +0 -0
  370. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/TESSA_source/MCMC_control.R +0 -0
  371. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/TESSA_source/TrainedEncoder.h5 +0 -0
  372. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/TESSA_source/fixed_b.csv +0 -0
  373. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/TESSA_source/initialization.R +0 -0
  374. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/TESSA_source/post_analysis.R +0 -0
  375. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/TESSA_source/real_data.R +0 -0
  376. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/TESSA_source/update.R +0 -0
  377. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/TESSA_source/utility.R +0 -0
  378. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/scripts/tcr/immunarch-patched.R +0 -0
  379. {biopipen-0.27.9 → biopipen-1.1.4}/biopipen/utils/__init__.py +0 -0
@@ -0,0 +1,27 @@
1
+ Metadata-Version: 2.4
2
+ Name: biopipen
3
+ Version: 1.1.4
4
+ Summary: Bioinformatics processes/pipelines that can be run from `pipen run`
5
+ License: MIT
6
+ Author: pwwang
7
+ Author-email: pwwang@pwwang.com
8
+ Requires-Python: >=3.9,<4.0
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Provides-Extra: log2file
18
+ Provides-Extra: runinfo
19
+ Requires-Dist: datar[pandas] (>=0.15.8,<0.16.0)
20
+ Requires-Dist: pipen-board[report] (>=1.1,<2.0)
21
+ Requires-Dist: pipen-cli-run (>=1.0,<2.0)
22
+ Requires-Dist: pipen-deprecated (>=1.0,<2.0)
23
+ Requires-Dist: pipen-filters (>=1.1.2,<2.0.0)
24
+ Requires-Dist: pipen-log2file (>=1.1,<2.0) ; extra == "log2file"
25
+ Requires-Dist: pipen-poplog (>=1.1,<2.0)
26
+ Requires-Dist: pipen-runinfo (>=1.1,<2.0) ; extra == "runinfo"
27
+ Requires-Dist: pipen-verbose (>=1.1,<2.0)
@@ -0,0 +1 @@
1
+ __version__ = "1.1.4"
@@ -1,11 +1,17 @@
1
1
  # Executables or binaries
2
2
  [exe]
3
+ # BeEM: https://github.com/kad-ecoli/BeEM
4
+ beem = "BeEM"
3
5
  # bedtools to handle bed files
4
6
  bedtools = "bedtools"
5
7
  # bcftools to handle bcf/vcf files
6
8
  bcftools = "bcftools"
9
+ # calculate_rmsd: https://github.com/charnley/rmsd
10
+ calculate_rmsd = "calculate_rmsd"
7
11
  # cellranger
8
12
  cellranger = "cellranger"
13
+ # cellsnp-lite
14
+ cellsnp_lite = "cellsnp-lite"
9
15
  # Control-FREEC to call cnvs
10
16
  freec = "freec"
11
17
  # liftover coordinates across genomes
@@ -13,6 +19,8 @@ liftover = "liftOver"
13
19
  # gatk, installed via conda
14
20
  gatk = "gatk"
15
21
  gatk4 = "gatk"
22
+ # google cloud sdk
23
+ gcloud = "gcloud"
16
24
  # vdjtools, installed via conda
17
25
  vdjtools = "vdjtools"
18
26
  # cnvkit.py
@@ -23,12 +31,20 @@ cnvpytor = "cnvpytor"
23
31
  cnvnator2vcf = "cnvnator2VCF.pl"
24
32
  # convert
25
33
  convert = "convert"
34
+ # fimo from meme
35
+ fimo = "fimo"
36
+ # MAXIT: https://sw-tools.rcsb.org/apps/MAXIT/
37
+ maxit = "maxit"
38
+ # MQuad: https://github.com/single-cell-genetics/MQuad
39
+ mquad = "mquad"
26
40
  # wget
27
41
  wget = "wget"
28
42
  # aria2c
29
43
  aria2c = "aria2c"
30
44
  # plink
31
45
  plink = "plink"
46
+ # plink2
47
+ plink2 = "plink2"
32
48
  # tabix
33
49
  tabix = "tabix"
34
50
  # sambamba
@@ -86,6 +102,10 @@ genome = ""
86
102
  # Database file for scType
87
103
  # https://github.com/IanevskiAleksandr/sc-type/
88
104
  sctype_db = ""
105
+ # TF Motif database
106
+ tf_motifdb = ""
107
+ # TF motif pairs
108
+ tf_motifs = ""
89
109
 
90
110
  [misc]
91
111
  # Number of cores used for each job
@@ -1,13 +1,16 @@
1
1
  """Additional filters for pipen"""
2
2
  from __future__ import annotations
3
3
 
4
+ import re
4
5
  import shlex
5
6
  from pathlib import Path
6
7
  from typing import Any, List, Mapping
7
8
 
8
- from argx import Namespace
9
+ from argx import Namespace # pyright: ignore[reportPrivateImportUsage]
9
10
  from liquid.filters.manager import FilterManager
10
- from pipen_report.filters import register_component, render_ui, _tag
11
+ from pipen_report.filters import register_component, _tag
12
+
13
+ # from .defaults import BIOPIPEN_DIR
11
14
 
12
15
  filtermanager = FilterManager()
13
16
 
@@ -15,7 +18,7 @@ filtermanager = FilterManager()
15
18
  @filtermanager.register
16
19
  def dict_to_cli_args(
17
20
  dic: Mapping[str, Any],
18
- exclude: List[str] = None,
21
+ exclude: List[str] | None = None,
19
22
  prefix: str | None = None,
20
23
  sep: str | None = " ",
21
24
  dup_key: bool = True,
@@ -28,7 +31,7 @@ def dict_to_cli_args(
28
31
 
29
32
  Args:
30
33
  dic: The dict to convert
31
- exclude: The keys to exclude
34
+ exclude: The keys to exclude before conversion (e.g. dashify)
32
35
  prefix: The prefix of the keys after conversion
33
36
  Defaults to `None`, mean `-` for short keys and `--` for long keys
34
37
  sep: The separator between key and value
@@ -118,7 +121,7 @@ def dict_to_cli_args(
118
121
  def r(
119
122
  obj: Any,
120
123
  ignoreintkey: bool = True,
121
- todot: str = None,
124
+ todot: str | None = None,
122
125
  sortkeys: bool = False,
123
126
  skip: int = 0,
124
127
  _i: int = 0,
@@ -169,8 +172,10 @@ def r(
169
172
  return "TRUE"
170
173
  if obj.upper() == "FALSE":
171
174
  return "FALSE"
172
- if obj.upper() == "NA" or obj.upper() == "NULL":
175
+ if obj.upper() == "NA" or obj.upper() == "NULL" or obj == "None":
173
176
  return obj.upper()
177
+ if re.match(r"^\d+:\d+$", obj):
178
+ return obj
174
179
  if obj.startswith("r:") or obj.startswith("R:"):
175
180
  return str(obj)[2:]
176
181
  return repr(str(obj))
@@ -221,69 +226,31 @@ def r(
221
226
  return repr(obj)
222
227
 
223
228
 
224
- @register_component("fgsea")
225
- def _render_fgsea(
226
- cont: Mapping[str, Any],
227
- job: Mapping[str, Any],
228
- level: int,
229
- na_arg: str = "10",
230
- ) -> str:
231
- """Render fgsea report"""
232
- # cont["dir"] is required
233
- n_pathways = int(na_arg)
234
- pathways = []
235
- with Path(cont["dir"]).joinpath("fgsea.txt").open() as f:
236
- next(f) # skip header
237
- for line in f:
238
- items = line.strip().split("\t")
239
- pathways.append((items[0], items[-1]))
240
- if len(pathways) >= n_pathways:
241
- break
242
-
243
- components = [
244
- # Summary
245
- {
246
- "title": "Enrichment Analysis Summary",
247
- "ui": "tabs",
248
- "contents": [
249
- {
250
- "title": "Plot",
251
- "ui": "flat",
252
- "contents": [
253
- {
254
- "kind": "image",
255
- "src": str(Path(cont["dir"]).joinpath("gsea_table.png")),
256
- }
257
- ],
258
- },
259
- {
260
- "title": "Table",
261
- "ui": "flat",
262
- "contents": [
263
- {
264
- "kind": "table",
265
- "src": str(Path(cont["dir"]).joinpath("fgsea.txt")),
266
- "data": {"excluded": {"slug"}},
267
- }
268
- ],
269
- },
270
- ]
271
- },
272
- # Pathways
273
- {
274
- "title": f"Enriched Pathways (Top {n_pathways})",
275
- "ui": "table_of_images",
276
- "contents": [
277
- {
278
- "src": str(Path(cont["dir"]) / f"fgsea_{slug}.png"),
279
- "title": pw,
280
- }
281
- for pw, slug in pathways
282
- ]
283
- },
284
- ]
285
-
286
- return render_ui(components, "accordion", job, level)
229
+ @filtermanager.register
230
+ def source_r(path: str | Path, chdir: bool = False) -> str:
231
+ """Source an R script.
232
+
233
+ In addition to generating `source(path)`, we also include the mtime for the script
234
+ to trigger the job not cached when the script is updated.
235
+
236
+ If your process is used in a cloud environment, it is recommended to
237
+ use the `read` filter to load the script content instead of sourcing it using
238
+ the `source` function in R to void the path issue (path could be different
239
+ in different environments).
240
+
241
+ Args:
242
+ path: The path to the R script
243
+
244
+ Returns:
245
+ The R code to source the script
246
+ """
247
+ path = Path(path)
248
+ mtime = int(path.stat().st_mtime)
249
+ return (
250
+ f"# Last modified: {mtime}\n"
251
+ # f"biopipen_dir = {r(BIOPIPEN_DIR)}\n"
252
+ f"source('{path}', chdir = {r(chdir)})"
253
+ )
287
254
 
288
255
 
289
256
  @register_component("pdf")
@@ -313,72 +280,3 @@ def _render_gsea(
313
280
  """Render gsea report"""
314
281
  # cont["dir"] is required
315
282
  raise NotImplementedError()
316
-
317
-
318
- @register_component("enrichr")
319
- def _render_enrichr(
320
- cont: Mapping[str, Any],
321
- job: Mapping[str, Any],
322
- level: int,
323
- ) -> str:
324
- """Render enrichr report"""
325
- # cont["dir"] is required
326
- dbs = [sumfile.stem[8:] for sumfile in Path(cont["dir"]).glob("Enrichr-*.txt")]
327
- components = []
328
-
329
- for db in dbs:
330
- enrichr_plot = Path(cont["dir"]).joinpath(f"Enrichr-{db}.png")
331
- if enrichr_plot.exists():
332
- components.append(
333
- {
334
- "title": db,
335
- "ui": "tabs",
336
- "contents": [
337
- {
338
- "title": "Plot",
339
- "ui": "flat",
340
- "contents": [
341
- {
342
- "kind": "image",
343
- "src": str(
344
- Path(cont["dir"]).joinpath(f"Enrichr-{db}.png")
345
- ),
346
- }
347
- ],
348
- },
349
- {
350
- "title": "Table",
351
- "ui": "flat",
352
- "contents": [
353
- {
354
- "kind": "table",
355
- "src": str(
356
- Path(cont["dir"]).joinpath(f"Enrichr-{db}.txt")
357
- ),
358
- }
359
- ],
360
- },
361
- ],
362
- }
363
- )
364
- else:
365
- components.append(
366
- {
367
- "title": db,
368
- "ui": "tabs",
369
- "contents": [
370
- {
371
- "title": "Error",
372
- "ui": "flat",
373
- "contents": [
374
- {
375
- "kind": "error",
376
- "content": "No enriched terms found.",
377
- }
378
- ],
379
- },
380
- ],
381
- }
382
- )
383
-
384
- return render_ui(components, "accordion", job, level)
@@ -1,7 +1,9 @@
1
1
  """Provides a base class for the processes to subclass"""
2
- from diot import Diot
2
+ from __future__ import annotations
3
+
4
+ from diot import Diot # type: ignore
3
5
  from liquid.defaults import SEARCH_PATHS
4
- from pipen import Proc as PipenProc
6
+ from pipen import Proc as PipenProc # type: ignore
5
7
  from pipen_filters.filters import FILTERS
6
8
 
7
9
  from .filters import filtermanager
@@ -23,7 +25,7 @@ class Proc(PipenProc):
23
25
  template_opts = {
24
26
  "globals": {**FILTERS, "biopipen_dir": str(BIOPIPEN_DIR)},
25
27
  "filters": {**FILTERS, **filtermanager.filters},
26
- "search_paths": SEARCH_PATHS + [str(REPORT_DIR)],
28
+ "search_paths": SEARCH_PATHS + [str(REPORT_DIR)], # type: ignore
27
29
  }
28
30
 
29
31
  plugin_opts = {
@@ -6,7 +6,8 @@ from pathlib import Path
6
6
  from pipen import Pipen
7
7
 
8
8
  TESTING_INDEX_INIT = 1
9
- TESTING_PARENT_DIR = Path(tempfile.gettempdir())
9
+ TESTING_PARENT_DIR = Path(__file__).parent.parent.parent.joinpath("tests", "running")
10
+ TESTING_PARENT_DIR.mkdir(parents=True, exist_ok=True)
10
11
  TESTING_DIR = str(TESTING_PARENT_DIR.joinpath("biopipen-tests-%(index)s"))
11
12
  RSCRIPT_DIR = TESTING_PARENT_DIR.joinpath("biopipen-tests-rscripts")
12
13
  RSCRIPT_DIR.mkdir(exist_ok=True)
@@ -44,12 +45,19 @@ def get_pipeline(testfile, loglevel="debug", enable_report=False, **kwargs):
44
45
  """Get a pipeline for a test file"""
45
46
  name, workdir, outdir = _get_test_dirs(testfile, False)
46
47
  report_plugin_prefix = "+" if enable_report else "-"
48
+ plugins = kwargs.pop("plugins", [])
49
+ if any("report" in p for p in plugins if isinstance(p, str)):
50
+ raise ValueError(
51
+ "Do not pass `report` plugin to `get_pipeline(plugins=[...])`, "
52
+ "use `enable_report` instead."
53
+ )
54
+ plugins.append(f"{report_plugin_prefix}report")
47
55
  kws = {
48
56
  "name": name,
49
57
  "workdir": workdir,
50
58
  "outdir": outdir,
51
59
  "loglevel": loglevel,
52
- "plugins": [f"{report_plugin_prefix}report"],
60
+ "plugins": plugins,
53
61
  }
54
62
  kws.update(kwargs)
55
63
  return Pipen(**kws)
@@ -96,7 +104,12 @@ def r_test(mem: callable) -> callable:
96
104
  )
97
105
  rcode = f"{expect}\n\n{rcode}\n\ncat('PASSED')\n"
98
106
  if source is not None:
99
- rcode = f'suppressWarnings(source("{self.SOURCE_FILE}"))\n\n{rcode}'
107
+ if not isinstance(source, (list, tuple)):
108
+ source = [source]
109
+
110
+ libs = "\n".join([f"suppressWarnings(source('{s}'))" for s in source])
111
+ rcode = f'{libs}\n\n{rcode}'
112
+
100
113
  out = _run_rcode(rcode)
101
114
  self.assertEqual(
102
115
  out,
@@ -4,6 +4,9 @@ from ..core.proc import Proc
4
4
  from ..core.config import config
5
5
 
6
6
 
7
+ # +-------------------------------------------------------------------+
8
+ # | CNV callers |
9
+ # +-------------------------------------------------------------------+
7
10
  class CNVpytor(Proc):
8
11
  """Detect CNV using CNVpytor
9
12
 
@@ -17,7 +20,6 @@ class CNVpytor(Proc):
17
20
 
18
21
  Envs:
19
22
  cnvpytor: Path to cnvpytor
20
- cnvnator2vcf: Path to CNVnator2VCF.pl to convert the result to VCF file
21
23
  samtools: Path to samtools, used to index bam file in case it's not
22
24
  ncores: Number of cores to use (`-j` for cnvpytor)
23
25
  refdir: The directory containing the fasta file for each chromosome
@@ -27,21 +29,19 @@ class CNVpytor(Proc):
27
29
  binsizes: The binsizes
28
30
  snp: How to read snp data
29
31
  filters: The filters to filter the result
30
- See - https://github.com/abyzovlab/CNVpytor/blob/master
31
- /GettingStarted.md#predicting-cnv-regions
32
+ See - https://github.com/abyzovlab/CNVpytor/blob/master/GettingStarted.md#predicting-cnv-regions
32
33
  mask_snps: Whether mask 1000 Genome snps
33
34
  baf_nomask: Do not use P mask in BAF histograms
34
35
 
35
36
  Requires:
36
37
  cnvpytor:
37
38
  - check: {{proc.envs.cnvpytor}} --version
38
- """
39
+ """ # noqa: E501
39
40
  input = "bamfile:file, snpfile:file"
40
41
  output = "outdir:dir:{{in.bamfile | stem}}.cnvpytor"
41
42
  lang = config.lang.python
42
43
  envs = {
43
44
  "cnvpytor": config.exe.cnvpytor,
44
- "cnvnator2vcf": config.exe.cnvnator2vcf,
45
45
  "samtools": config.exe.samtools,
46
46
  "ncores": config.misc.ncores,
47
47
  "refdir": config.ref.refdir,
@@ -152,7 +152,7 @@ class CNAClinic(Proc):
152
152
  A list of sample names
153
153
  A float number (0 < x <= 1), the fraction of samples to use
154
154
  A integer number (x > 1), the number of samples to use
155
- binsize: Directly use this binsize for CNAClinic, in kbp.
155
+ binsize: Directly use this binsize for CNAClinic, in bp.
156
156
  genome: The genome assembly
157
157
  run_args: The arguments for CNAClinic::runSegmentation
158
158
  plot_args: The arguments for CNAClinic::plotSampleData
@@ -183,6 +183,9 @@ class CNAClinic(Proc):
183
183
  }
184
184
 
185
185
 
186
+ # +-------------------------------------------------------------------+
187
+ # | Bam processing tools |
188
+ # +-------------------------------------------------------------------+
186
189
  class BamSplitChroms(Proc):
187
190
  """Split bam file by chromosomes
188
191
 
@@ -262,3 +265,142 @@ class BamMerge(Proc):
262
265
  "sort_args": [],
263
266
  }
264
267
  script = "file://../scripts/bam/BamMerge.py"
268
+
269
+
270
+ class BamSampling(Proc):
271
+ """Keeping only a fraction of read pairs from a bam file
272
+
273
+ Input:
274
+ bamfile: The bam file
275
+
276
+ Output:
277
+ outfile: The output bam file
278
+
279
+ Envs:
280
+ ncores: Number of cores to use
281
+ samtools: Path to samtools executable
282
+ tool: The tool to use, currently only "samtools" is supported
283
+ fraction (type=float): The fraction of reads to keep.
284
+ If `0 < fraction <= 1`, it's the fraction of reads to keep.
285
+ If `fraction > 1`, it's the number of reads to keep.
286
+ Note that when fraction > 1, you may not get the exact number
287
+ of reads specified but a close number.
288
+ seed: The seed for random number generator
289
+ index: Whether to index the output bam file
290
+ sort: Whether to sort the output bam file
291
+ sort_args: The arguments for sorting bam file using `samtools sort`.
292
+ These keys are not allowed: `-o`, `-@`,
293
+ and `--threads`, as they are managed by the script.
294
+ """
295
+ input = "bamfile:file"
296
+ output = "outfile:file:{{in.bamfile | stem}}.sampled{{envs.fraction}}.bam"
297
+ lang = config.lang.python
298
+ envs = {
299
+ "ncores": config.misc.ncores,
300
+ "samtools": config.exe.samtools,
301
+ "tool": "samtools",
302
+ "fraction": None,
303
+ "seed": 8525,
304
+ "index": True,
305
+ "sort": True,
306
+ "sort_args": [],
307
+ }
308
+ script = "file://../scripts/bam/BamSampling.py"
309
+
310
+
311
+ class BamSubsetByBed(Proc):
312
+ """Subset bam file by the regions in a bed file
313
+
314
+ Input:
315
+ bamfile: The bam file
316
+ bedfile: The bed file
317
+
318
+ Output:
319
+ outfile: The output bam file
320
+
321
+ Envs:
322
+ ncores: Number of cores to use
323
+ samtools: Path to samtools executable
324
+ tool: The tool to use, currently only "samtools" is supported
325
+ index: Whether to index the output bam file
326
+ """
327
+ input = "bamfile:file, bedfile:file"
328
+ output = "outfile:file:{{in.bamfile | stem}}-subset.bam"
329
+ lang = config.lang.python
330
+ envs = {
331
+ "ncores": config.misc.ncores,
332
+ "samtools": config.exe.samtools,
333
+ "tool": "samtools",
334
+ "index": True,
335
+ }
336
+ script = "file://../scripts/bam/BamSubsetByBed.py"
337
+
338
+
339
+ class BamSort(Proc):
340
+ """Sort bam file
341
+
342
+ Input:
343
+ bamfile: The bam file
344
+
345
+ Output:
346
+ outfile: The output bam file
347
+
348
+ Envs:
349
+ tool (choice): The tool to use.
350
+ - samtools: Use `samtools`
351
+ - sambamba: Use `sambamba`
352
+ ncores (type=int): Number of cores to use
353
+ samtools: Path to samtools executable
354
+ sambamba: Path to sambamba executable
355
+ tmpdir: The temporary directory to use
356
+ byname (flag): Whether to sort by read name
357
+ index (flag): Whether to index the output bam file
358
+ The index file will be created in the same directory as the output
359
+ bam file
360
+ <more>: Other arguments passed to the sorting tool
361
+ See `samtools sort` or `sambamba sort`
362
+ """
363
+ input = "bamfile:file"
364
+ output = "outfile:file:{{in.bamfile | stem}}.sorted.bam"
365
+ lang = config.lang.python
366
+ envs = {
367
+ "tool": "samtools",
368
+ "ncores": config.misc.ncores,
369
+ "samtools": config.exe.samtools,
370
+ "sambamba": config.exe.sambamba,
371
+ "tmpdir": config.path.tmpdir,
372
+ "byname": False,
373
+ "index": True,
374
+ }
375
+ script = "file://../scripts/bam/BamSort.py"
376
+
377
+
378
+ class SamtoolsView(Proc):
379
+ """View bam file using samtools, mostly used for filtering
380
+
381
+ This is a wrapper for `samtools view` command.
382
+ It will create a new bam file with the same name as the input bam file.
383
+
384
+ Input:
385
+ bamfile: The bam file
386
+
387
+ Output:
388
+ outfile: The output bam file
389
+
390
+ Envs:
391
+ ncores: Number of cores to use
392
+ samtools: Path to samtools executable
393
+ index: Whether to index the output bam file
394
+ Requires the input bam file to be sorted.
395
+ <more>: Other arguments passed to the view tool
396
+ See `samtools view` or `sambamba view`.
397
+ """
398
+ input = "bamfile:file"
399
+ output = "outfile:file:{{in.bamfile | stem}}.bam"
400
+ lang = config.lang.python
401
+ envs = {
402
+ "ncores": config.misc.ncores,
403
+ "samtools": config.exe.samtools,
404
+ "index": True,
405
+ }
406
+ script = "file://../scripts/bam/SamtoolsView.py"
@@ -163,3 +163,78 @@ class BedtoolsMerge(Proc):
163
163
  "bedtools": config.exe.bedtools,
164
164
  }
165
165
  script = "file://../scripts/bed/BedtoolsMerge.py"
166
+
167
+
168
+ class BedtoolsIntersect(Proc):
169
+ """Find the intersection of two BED files, using `bedtools intersect`
170
+
171
+ See <https://bedtools.readthedocs.io/en/latest/content/tools/intersect.html>
172
+
173
+ Input:
174
+ afile: The first BED file
175
+ bfile: The second BED file
176
+
177
+ Output:
178
+ outfile: The output BED file
179
+
180
+ Envs:
181
+ bedtools: The path to bedtools
182
+ sort: Sort `afile` and `bfile` before intersecting.
183
+ By default, `-sorted` is used, assuming the input files are sorted.
184
+ If error occurs, try to set `sort` to `True`.
185
+ chrsize: Alias for `g` in `bedtools intersect`.
186
+ postcmd: The command to be executed for the output file after intersecting.
187
+ You can use `$infile`, `$outfile`, and `$outdir` to refer to the input,
188
+ output, and output directory, respectively.
189
+ <more>: Other options to be passed to `bedtools intersect`
190
+ """ # noqa: E501
191
+ input = "afile:file", "bfile:file"
192
+ output = "outfile:file:{{in.afile | stem0}}_{{in.bfile | stem0}}-intersect.bt"
193
+ lang = config.lang.python
194
+ envs = {
195
+ "bedtools": config.exe.bedtools,
196
+ "sort": False,
197
+ "chrsize": config.ref.chrsize,
198
+ "postcmd": None,
199
+ }
200
+ script = "file://../scripts/bed/BedtoolsIntersect.py"
201
+
202
+
203
+ class BedtoolsMakeWindows(Proc):
204
+ """Make windows from a BED file or genome size file, using `bedtools makewindows`.
205
+
206
+ Input:
207
+ infile: The input BED file or a genome size file
208
+ Type will be detected by the number of columns in the file.
209
+ If it has 3+ columns, it is treated as a BED file, otherwise
210
+ a genome size file.
211
+
212
+ Output:
213
+ outfile: The output BED file
214
+
215
+ Envs:
216
+ bedtools: The path to bedtools
217
+ window (type=int): The size of the windows
218
+ step (type=int): The step size of the windows
219
+ nwin (type=int): The number of windows to be generated
220
+ Exclusive with `window` and `step`.
221
+ Either `nwin` or `window` and `step` should be provided.
222
+ reverse (flag): Reverse numbering of windows in the output
223
+ name (choice): How to name the generated windows/regions
224
+ - none: Do not add any name
225
+ - src: Use the source interval's name
226
+ - winnum: Use the window number
227
+ - srcwinnum: Use the source interval's name and window number
228
+ """ # noqa: E501
229
+ input = "infile:file"
230
+ output = "outfile:file:{{in.infile | stem}}_windows.bed"
231
+ lang = config.lang.python
232
+ envs = {
233
+ "bedtools": config.exe.bedtools,
234
+ "window": None,
235
+ "step": None,
236
+ "nwin": None,
237
+ "reverse": False,
238
+ "name": "none",
239
+ }
240
+ script = "file://../scripts/bed/BedtoolsMakeWindows.py"