Snakefile.ref 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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["Annotation_Dir"] + "/my.emapper.annotations", # eggnog-mapper annotation result
  25. config["Annotation_Dir"] + "/anno_stat.txt", # annotation statistics
  26. config["Annotation_Dir"] + "/my.nr.diamond.tab", # nr blast result
  27. config["Quantification_Dir"] + "/my.gene.counts.matrix", # gene counts matrix
  28. config["Quantification_Dir"] + "/my.gene.TMM.EXPR.matrix", # TMP and TMM normalized matrix
  29. config["Quantification_Dir"] + "/my.gene.TMM.EXPR.matrix.stat.txt",
  30. config["ExprAnalysis_Dir"] + "/sample_cor/my.minRow10.sample_cor.dat", # sample correlation
  31. config["ExprAnalysis_Dir"] + "/sample_cor/my.minRow10.sample_cor_matrix.pdf", # sample correlation plot
  32. config["ExprAnalysis_Dir"] + "/pca/my.minRow10.PCA.prcomp.scores", # sample PCA
  33. config["ExprAnalysis_Dir"] + "/pca/my.minRow10.prcomp.principal_components.pdf", # sample PCA plot
  34. expand(ExprAnalysis_Dir + "/deg/my.gene.counts.matrix.{vs}.DESeq2.DE_results", vs=CONTRASTS),
  35. expand(ExprAnalysis_Dir + "/deg/my.gene.counts.matrix.{vs}.DESeq2.DE_results.ekp_results.txt", vs = CONTRASTS)