Skip to content

Instantly share code, notes, and snippets.

View drigodwin's full-sized avatar

Duncan Godwin drigodwin

View GitHub Profile
@drigodwin
drigodwin / timestamp.js
Last active January 8, 2019 14:32
CSO Board
var countdown_date = 1544634000000;
<cfset greeting="hello world">
<cfoutput>#greeting#</cfoutput>
tpm <- function(counts, lengths) {
rate <- counts / lengths
rate / sum(rate) * 1e6
}
ftr.cnt <- read.table("counts.txt", sep="\t", stringsAsFactors=FALSE,
header=TRUE)
library(dplyr)
library(tidyr)
fc <- featureCounts(file="esc.bam",annot.ext="../../../genomes/Mus_musculus/Ensembl/NCBIM37/Annotation/Genes/Mus_musculus.NCBIM37.58.gtf",isGTFAnnotationFile = TRUE,GTF.featureType = "CDS",GTF.attrType = "gene_id")
write.table(x=data.frame(fc$annotation[,c("GeneID","Length")],fc$counts,stringsAsFactors=FALSE),file="counts.txt",quote=FALSE,sep="\t",row.names=FALSE)
//========================== featureCounts setting ===========================\\
|| ||
|| Input files : 1 BAM file ||
|| P esc.bam ||
|| ||
|| Dir for temp files : . ||
|| Threads : 1 ||
|| Level : meta-feature level ||
|| Paired-end : no ||
|| Strand specific : no ||
Status esc.bam
1 Assigned 7750622
2 Unassigned_Unmapped 0
3 Unassigned_MappingQuality 0
4 Unassigned_Chimera 0
5 Unassigned_FragmentLength 0
6 Unassigned_Duplicate 0
7 Unassigned_MultiMapping 21821282
8 Unassigned_Secondary 0
@drigodwin
drigodwin / test.gist
Created February 1, 2017 15:32
test.gist
This is an empty test file
@drigodwin
drigodwin / resolv.gist
Last active June 18, 2019 10:34
Sets the nameserver to Google DNS
${r"sudo sed -i.bak '/^nameserver /{h;s/.*/nameserver 8\.8\.8\.8/};${x;/^$/{s//nameserver 8\.8\.8\.8/;H};x}' /etc/resolv.conf"}
This file has been truncated, but you can view the full file.
2016-10-18 10:27:56,341 DEBUG 102 j.headers [er-LsPYHwKd-1111] >> GET https://cloudsoft2-lon.openstack.blueboxgrid.com:8774/v2/a0ade3ca76784719845363979dc1014e/os-security-groups HTTP/1.1
2016-10-18 10:27:56,341 DEBUG 102 j.headers [er-LsPYHwKd-1111] >> Accept: application/json
2016-10-18 10:27:56,341 DEBUG 102 j.headers [er-LsPYHwKd-1111] >> X-Auth-Token: 428b4d663e4943cdb13348ebe2dd169a
2016-10-18 10:28:02,322 DEBUG 102 j.headers [er-LsPYHwKd-1111] << HTTP/1.1 200 OK
2016-10-18 10:28:02,322 DEBUG 102 j.headers [er-LsPYHwKd-1111] << Date: Tue, 18 Oct 2016 09:28:02 GMT
2016-10-18 10:28:02,322 DEBUG 102 j.headers [er-LsPYHwKd-1111] << Connection: close
2016-10-18 10:28:02,322 DEBUG 102 j.headers [er-LsPYHwKd-1111] << X-Compute-Request-Id: req-7489d376-9d69-4618-99ea-0b2bee13c589
2016-10-18 10:28:02,323 DEBUG 102 j.headers [er-LsPYHwKd-1111] << Content-Type: application/json
2016-10-18 10:28:02,323 DEBUG 102 j.headers [er-LsPYHwKd-1111] << Content-Length: 164061