Skip to content

Instantly share code, notes, and snippets.

View adomingues's full-sized avatar

A. Domingues adomingues

View GitHub Profile
@adomingues
adomingues / deseq_zero_counts.Rmd
Created May 8, 2023 15:50
Re-analysis of a dataset which strange differential expressed genes
```{r }
library("recount3")
library("data.table")
library("magrittr")
library("DESeq2")
rse <- recount3::create_rse_manual(
project = "ERP010060",
project_home = "data_sources/sra",
organism = "human",
@adomingues
adomingues / hg_to_git_conversion_draft.sh
Created December 25, 2020 12:54
Convert hg (mercurial) to git repos
find . -maxdepth 2 -name ".hg" -type d
## convert hg to git
pip install mercurial ## apt install did not work with the conversion tool
## install conversion tool
mkdir -p ~/bin
cd ~/bin/
git clone https://github.com/frej/fast-export.git
@adomingues
adomingues / list_repos_with_branches.sh
Created December 24, 2020 13:20
crawl all sub-directories wich are git repos and list those with more than one branch
parent=$(pwd)
for repo in $(find ${parent} -maxdepth 2 -name ".git" -type d | sed 's/.git//'); do
cd ${repo}
n=$(git branch | wc -l)
if [[ ${n} -gt 1 ]]; then
echo ${repo}
fi
cd ${parent}
done
@adomingues
adomingues / add_password_to_ssh_keys.sh
Created May 28, 2020 08:26
Add a password to an OpenSSH private key generated without a password
cd .ssh/
mkdir -p ~/.ssh/backup_keys
## backup current keys just in case
for k in id_*; do
cp $k backup_keys/$k"_bak_$(date +"%m_%d_%Y")"
done
## it will ask for a password for every key file
for k in $(ls id_* | grep -v pub); do
@adomingues
adomingues / session_info_derfinder_10092019.R
Created September 10, 2019 21:50
Session info for an issue
sessionInfo() R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)
Matrix products: default
BLAS: /fsimb/common/tools/R/3.5.1/lib/R/lib/libRblas.so
LAPACK: /fsimb/common/tools/R/3.5.1/lib/R/lib/libRlapack.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
@adomingues
adomingues / session_info_bioC_16072019.R
Created July 18, 2019 13:12
session info for bioC question 16.07.2019
sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.5
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
locale:
## set default repository
options(repos = "http://cran.rstudio.com")
## install packages if missing
suppressMessages(if (!require("devtools")) utils::install.packages("devtools"))
suppressMessages(if (!require("rdoc")) devtools::install_github("mdequeljoe/rdoc"))
suppressMessages(if (!require("prettycode")) utils::install.packages("prettycode"))
## prettify the docs
rdoc::use_rdoc()
@adomingues
adomingues / readBAM.R
Created January 3, 2019 09:13 — forked from SamBuckberry/readBAM.R
Import a bam file into R
# install the Rsamtools package if necessary
source("http://bioconductor.org/biocLite.R")
biocLite("Rsamtools")
# load the library
library(Rsamtools)
# specify the bam file you want to import
bamFile <- "test.bam"
@adomingues
adomingues / session_info.R
Created December 3, 2018 12:25
session info for collapseReplicates question
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.5 LTS
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
@adomingues
adomingues / deseq2_factors.R
Created December 3, 2018 12:20
BioC question re factor levels after collapseReplicates
samples <- structure(list(sample = structure(c(3L, 4L, 5L, 6L, 7L, 8L, 9L,
10L, 1L, 2L, 14L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 20L, 21L,
22L, 23L, 23L, 24L, 25L, 11L, 12L, 13L), .Label = c("wt_Fish_10dpf_rep1_mRNA",
"wt_Fish_10dpf_rep2_mRNA", "wt_Fish_1dpf_rep1_mRNA", "wt_Fish_1dpf_rep2_mRNA",
"wt_Fish_2dpf_rep1_mRNA", "wt_Fish_2dpf_rep2_mRNA", "wt_Fish_3dpf_rep1_mRNA",
"wt_Fish_3dpf_rep2_mRNA", "wt_Fish_6dpf_rep1_mRNA", "wt_Fish_6dpf_rep2_mRNA",
"wt_PGCs_10dpf_rep1_mRNA", "wt_PGCs_10dpf_rep2_mRNA", "wt_PGCs_10dpf_rep3_mRNA",
"wt_PGCs_1dpf_rep1_mRNA", "wt_PGCs_1dpf_rep2_mRNA", "wt_PGCs_1dpf_rep3_mRNA",
"wt_PGCs_2dpf_rep1_mRNA", "wt_PGCs_2dpf_rep2_mRNA", "wt_PGCs_2dpf_rep3_mRNA",
"wt_PGCs_3dpf_rep1_mRNA", "wt_PGCs_3dpf_rep2_mRNA", "wt_PGCs_3dpf_rep3_mRNA",