Snakefile.ref 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import pandas as pd
  2. ######################################################
  3. # config file
  4. ######################################################
  5. configfile: "config.yaml"
  6. ######################################################
  7. # read samples.txt to dict
  8. ######################################################
  9. SAMPLES = pd.read_csv(config["SAMPLES_FILE"], header=None, sep="\t").set_index(1, drop=False)[0].to_dict()
  10. f = open(config['contrasts'], 'r')
  11. CONTRASTS = [i.strip().replace('\t', '_vs_') for i in f.readlines()]
  12. ######################################################
  13. # Includes
  14. ######################################################
  15. include: "Includes/Annotation.snake"
  16. include: "Includes/Mapping_Ref.snake"
  17. include: "Includes/Quantification_Ref.snake"
  18. include: "Includes/ExprAnalysis.snake"
  19. ######################################################
  20. # result files
  21. ######################################################
  22. rule all:
  23. input:
  24. config["Quantification_Dir"] + "/my.gene.counts.matrix", # gene counts matrix
  25. config["Quantification_Dir"] + "/my.gene.TMM.EXPR.matrix", # TMP and TMM normalized matrix
  26. #config["Quantification_Dir"] + "/my.gene.TMM.EXPR.matrix.stat.txt",
  27. config["ExprAnalysis_Dir"] + "/sample_cor/my.minRow10.sample_cor.dat", # sample correlation
  28. config["ExprAnalysis_Dir"] + "/sample_cor/my.minRow10.sample_cor_matrix.pdf", # sample correlation plot
  29. config["ExprAnalysis_Dir"] + "/pca/my.minRow10.PCA.prcomp.scores", # sample PCA
  30. config["ExprAnalysis_Dir"] + "/pca/my.minRow10.prcomp.principal_components.pdf", # sample PCA plot
  31. expand(config["ExprAnalysis_Dir"] + "/deg/my.gene.counts.matrix.{vs}.DESeq2.DE_results", vs=CONTRASTS)
  32. #expand(config["ExprAnalysis_Dir"] + "/deg/my.gene.counts.matrix.{vs}.DESeq2.DE_results.ekp_results.txt", vs = CONTRASTS)