This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
Reads a FASTA file and if >1 sequence has the same description line, | |
it only keeps the longest sequence. It outputs all the sequencs to stdout | |
when complete. | |
""" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scanpy.api as sc | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
def get_cluster_proportions(adata, | |
cluster_key="cluster_final", | |
sample_key="replicate", | |
drop_values=None): | |
""" | |
Input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zcat file1.vcf.gz | awk -F"\t" '{if ($0 !~ /^#/) {print "chr"$0} else{print $0}}' | bgzip -c >file1chr.vcf.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# An R function to save pheatmap figure into pdf | |
# This was copied from Stackflow: https://stackoverflow.com/questions/43051525/how-to-draw-pheatmap-plot-to-screen-and-also-save-to-file | |
save_pheatmap_pdf <- function(x, filename, width=7, height=7) { | |
stopifnot(!missing(x)) | |
stopifnot(!missing(filename)) | |
pdf(filename, width=width, height=height) | |
grid::grid.newpage() | |
grid::grid.draw(x$gtable) |