Skip to content

Instantly share code, notes, and snippets.

View adomingues's full-sized avatar

A. Domingues adomingues

View GitHub Profile
@adomingues
adomingues / ggbio_error_laptop.session_info.r
Created August 15, 2018 08:32
Session info to report ggbio error (laptop)
Session info ------------------------------------------------------------------
setting value
version R version 3.5.1 (2018-07-02)
system x86_64, linux-gnu
ui X11
language en_US
collate en_US.UTF-8
tz Europe/Berlin
date 2018-08-15
@adomingues
adomingues / ggbio_error_server.session_info.r
Created August 15, 2018 08:27
Session info to report ggbio error (server)
> devtools::session_info()
Session info ------------------------------------------------------------------
setting value
version R version 3.4.3 (2017-11-30)
system x86_64, linux-gnu
ui X11
language en_US:en
collate en_US.UTF-8
tz Europe/Berlin
date 2018-08-15
@adomingues
adomingues / create_bitbucket_repo.sh
Last active August 26, 2018 07:30
Create a bit bucket repo from the command line and make a first push
#pip install --user bitbucket-cli
proj="some_project"
bitbucket create --private --protocol ssh --scm git ${proj}
git remote add origin https://adomingues@bitbucket.org/adomingues/${proj}.git
git push --set-upstream origin master
@adomingues
adomingues / DESeq2_test_arguments_pipeline.R
Last active May 29, 2018 08:02
Arguments to test the pipeline DESeq2
ftargets="targets.txt"
fcontrasts="contrasts.txt"
mmatrix="~group"
filter.genes=TRUE
prefix=""
suffix=".raw_readcounts.tsv"
cwd="results/subread-count_MM"
out="results/DE_DESeq2_MM"
gene.model="/fsimb/common/genomes/caenorhabditis_elegans/ensembl/WBcel235/full/annotation/Caenorhabditis_elegans.WBcel235.84.gtf"
@adomingues
adomingues / gtf_transcript_length
Created May 17, 2018 19:27 — forked from sp00nman/gtf_transcript_length
Calculate transcript length of GTF file
# resource: http://seqanswers.com/forums/showthread.php?t=4914
# Calculate length for each transcript for a GTF file
awk -F"\t" '
$3=="exon"
{
ID=substr($9, length($9)-16, 15);
L[ID]+=$5-$4+1
}
END{
for(i in L)
@adomingues
adomingues / expressions_atlas_session_info.R
Created December 19, 2017 11:29
ExpressionAtlas session info
R version 3.4.1 (2017-06-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)
Matrix products: default
BLAS: /usr/lib/atlas-base/libf77blas.so.3.0
LAPACK: /usr/lib/atlas-base/atlas/liblapack.so.3.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
@adomingues
adomingues / deseq2-analysis-template.R
Created December 19, 2017 11:25 — forked from stephenturner/deseq2-analysis-template.R
Template for analysis with DESeq2
## RNA-seq analysis with DESeq2
## Stephen Turner, @genetics_blog
# RNA-seq data from GSE52202
# http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=gse52202. All patients with
# ALS, 4 with C9 expansion ("exp"), 4 controls without expansion ("ctl")
# Import & pre-process ----------------------------------------------------
# Import data from featureCounts
Whilst running a `RIPSeeper` analysis, I noticed that the dataset `drerio_gene_ensembl` which used to be available via `biomaRt` is not longer listed or accessible. To test this I first upgraded my `bioC` to make sure I am working with the latest version of `biomaRt` (2.34.0).
```{r update, eval=FALSE}
biocLite("BiocUpgrade")
biocLite("BiocUpgrade")
```
I then followed the instructions in the [vignette](https://bioconductor.org/packages/release/bioc/vignettes/biomaRt/inst/doc/biomaRt.html) and connected to `ensembl`:
@adomingues
adomingues / recount_refinder_session_info.R
Created November 30, 2017 09:17
Session info for bioconductor Q
setting value
version R version 3.4.1 (2017-06-30)
system x86_64, linux-gnu
ui X11
language en_US:en
collate en_US.UTF-8
tz Europe/Berlin
date 2017-11-30
@adomingues
adomingues / convert_tx_to_gene.R
Last active October 19, 2017 12:40 — forked from hussius/sleuth_commands.R
tximport functions
# A function (borrowed from the Sleuth documentation) for connecting Ensembl transcript names to common gene names
convert_tx_to_gene <- function(dat="drerio_gene_ensembl"){
mart <- biomaRt::useMart(
biomart = "ensembl",
dataset = dat
)
t2g <- biomaRt::getBM(
attributes = c("ensembl_transcript_id", "ensembl_gene_id", "external_gene_name"),
mart = mart