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
fc_gene <- enrichPathway(gene=unique(names(fc)), pvalueCutoff=0.1, organism = "mouse", readable=T) | |
fc_gene | |
attributes(fc_gene) | |
index <- sapply(seq(1, length(fc_gene$Description)), function(x){return(which(fc_gene$Description == fc_gene$Description[x])[1] == x)}) | |
attr(fc_gene, "result") <- attr(fc_gene, "result")[index,] | |
dotplot(fc_gene, showCategory=15) |
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
fc_gene <- enrichPathway(gene=unique(names(fc)), pvalueCutoff=0.1, organism = "mouse", readable=T) | |
fc_gene | |
attributes(fc_gene) | |
index <- sapply(seq(1, length(fc_gene$Description)), function(x){return(which(fc_gene$Description == fc_gene$Description[x])[1] == x)}) | |
attr(fc_gene, "result") <- attr(fc_gene, "result")[index,] | |
dotplot(fc_gene, showCategory=15) |
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
def list_length(L): | |
if isinstance(L, (list, np.ndarray)): | |
if len(L) > 0 and isinstance(L[0], (list, np.ndarray)): | |
return [list_length(x) for x in L] | |
else: | |
return len(L) | |
return 0 |
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
samtools view -f 16 temp.bam \ | |
| awk 'BEGIN{OFS='\t'}{if(NF == 3 || length($10) >= 15) { print }}' \ | |
| cut -f6,6 | sed -e 's/.*[^S]$/0/g' -e 's/.*[A-Z]\([0-9]*\)S$/\1/g' | sort -n \ | |
| uniq -c > temp_rev.txt | |
samtools view -F 16 temp.bam \ | |
| awk 'BEGIN{OFS='\t'}{if(NF == 3 || length($10) >= 15) { print }}' \ | |
| cut -f6,6 | sed -e 's/^\([0-9]*\)S.*$/\1/g' -e 's/^.*[A-Z]$/0/g' | sort -n \ | |
| uniq -c > temp.txt | |
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
seq 0 5 | xargs -I{} echo "samtools view -F 16 {}.bam | grep -v "XS:" | awk 'BEGIN{OFS='\t'}{if(length(\$10) >= 15) { print }}' | cut -f6,6 | grep \"^[0-9]*S\" | cut -f1,1 -d\"S\" | sort -n | uniq -c > {}_local.txt " | bash | |
seq 0 5 | xargs -I{} echo "samtools view -f 16 {}.bam | grep -v "XS:" | awk 'BEGIN{OFS='\t'}{if(length(\$10) >= 15) { print }}' | cut -f6,6 | grep \"[0-9]*S$\" | sed 's/.*[A-Z]\([0-9]*\)S\$/\1/g' | sort -n | uniq -c > {}_local_rev.txt " | bash | |
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/env python | |
""" Please apply this script to paired-end reads when you happen to see the bowtie error shown as below. | |
Error, fewer reads in file specified with -2 than in file specified with -1 | |
terminate called after throwing an instance of 'int' | |
(ERR): bowtie2-align died with signal 6 (ABRT) (core dumped) | |
python read_truncate.py (1st fastq) (2nd fastq) | |
""" |
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
ERRORLIST=("SRRXXXXXX") #SRR number | |
for NAME in "${ERRORLIST[@]}" | |
do | |
echo $NAME | |
cat ${NAME}.fastq | grep "^@SRR" -A 3 | grep -v "^\-\-$" > ${NAME}_trimmed.fastq | |
python check_read.py ${NAME}_trimmed.fastq > ${NAME}_extracted.fastq | |
done |
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 sys | |
if __name__ == '__main__': | |
file = sys.argv[1] | |
list = [] | |
count = 0 | |
with open(file) as f: | |
for line in f.readlines(): | |
if count%4 == 1: | |
list.append(line) |
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
for (time in c(10, 100, 1000, 10000, 100000, 100000)) { | |
m <- c() | |
for (r in 1:10000) { | |
m <- c(m, max(rnorm(time))) | |
} | |
png(paste(time, ".png", sep="")) | |
plot(hist(m), xlim=c(-2,6)) | |
dev.off() | |
} |
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
from selenium import webdriver | |
from selenium.webdriver.common.action_chains import ActionChains | |
from selenium.webdriver.common.keys import Keys | |
driver = webdriver.Firefox() | |
driver.maximize_window() | |
driver.get("http://ksnctf.sweetduet.info/q/3/unya.html") | |
# driver.title | |
form = driver.find_element_by_xpath('//input[@type="text"]') | |
form.send_keys('c') |
NewerOlder