Skip to content

Instantly share code, notes, and snippets.

View tluquez's full-sized avatar

Tain Luquez tluquez

  • Columbia University
  • New York
  • X @tluquez
View GitHub Profile
@tluquez
tluquez / get_props.R
Last active May 11, 2024 14:38
get data frame of proportion of clusters per id and supercluster
summarize_by_group <- function(data, group, columns = NULL) {
#' Summarize data by group
#'
#' This function aggregates data by group and summarizes specified columns.
#'
#' @param data A data frame.
#' @param group A character vector specifying the grouping column(s).
#' @param columns Optional character vector specifying columns to summarize.
#' @return A data frame with summarized data.
#' @examples
@tluquez
tluquez / robust_glm.R
Last active May 11, 2024 14:40
GLM with robust weights and standard errors. Functions to tidy the results.
get_response <- function(formula) {
if (class(formula) != "formula") {
stop("Not formula object")
}
all.vars(formula[[length(formula) - 1]])
}
get_covs <- function(formula) {
if (class(formula) != "formula") {
stop("Not formula object")
@tluquez
tluquez / RNAseq_alldata_download.sh
Created July 12, 2018 17:38
Program to download the human reference genome (GCA_000001405.15_GRCh38_no_alt_analysis_set.fna.gz), the annotation file for that human reference genome (GCA_000001405.15_GRCh38_full_analysis_set.refseq_annotation.gff.gz) and also downloads all .fastq files from ENA supplied by the user in a text file.
#!/usr/bin/env bash
# MIT License
#
# Copyright (c) [2018] [Grupo de Bioquimica Experimental y Computacional from the Pontificia Universidad Javeriana and Tain Velasco-Luquez]
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@tluquez
tluquez / aspera_fastq_download_from_ENA.sh
Last active September 22, 2018 22:31
Script to download .fastq files from ENA (https://www.ebi.ac.uk/ena) using aspera (https://developer.asperasoft.com/desktop-advance/command-line-client). It can easily be extended to download other type of files from ENA. Example input file with the ENA urls for all .fastq files in the project ID PRJNA382448 is supplied. Note that the urls must …
#!/usr/bin/env bash
# MIT License
#
# Copyright (c) [2018] [Grupo de Bioquimica Experimental y Computacional from the Pontificia Universidad Javeriana and Tain Velasco-Luquez]
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell