Skip to content

Instantly share code, notes, and snippets.

View darencard's full-sized avatar

Daren Card darencard

View GitHub Profile

I am attesting that this GitHub handle darencard is linked to the Tezos account tz1aE51gtg4Rbim7hPZPmim2tE5EpMTmXhAG for tzprofiles

sig:edsigtzSNbxXjBfZyzBbmo72qaJzmkMEEHjAQULLbDmjjVUqWmMd8KDdJSBdeg14mbTEm5LmfUrZnBWDZ8VgdxWk5QaRjqQVumD

@darencard
darencard / ucsc_genome_track_setup.md
Last active November 4, 2023 09:16
Creating a UCSC Genome Track for viewing genome annotations
layout title date excerpt
posts
Visualizing Genome Annotations
2019-01-25
Creating a UCSC Genome Track for Viewing Genome Annotations

Creating a UCSC Genome Track for Viewing Genome Annotations

When creating a custom, in-house genome annotation, there is no straight-forward way to share it upon publication. NCBI does not accept and archive these, so most users just end up depositing the text files in an online repository. The UCSC Genome Browser team has fortunately come up with a decent way to share an annotation in a graphical manner, so readers can browse the assembly and annotation at some level without a lot of work.

@darencard
darencard / install_run_provean_notes.md
Created October 10, 2018 20:47
Notes on installing and running Provean

Notes from work installing and running Provean to predict protein impact of variants. Provean input files were produced based on VEP output using commands below. Some trial runs were completed using a computer to understand how quickly Provean can be run in parallel to work through all annotated genes.

# running PROVEAN

# installation & dependencies
# 1. checked that blast was installed and also reinstalled cd-hit to avoid issue with certain version
# 2. installed the NCBI nr database
sudo mkdir /opt/ncbi_blast_nr_db_2018-01-29
sudo chmod 775 /opt/ncbi_blast_nr_db_2018-01-29
@darencard
darencard / phastcons_conserved_extraction.md
Created October 10, 2018 20:45
Commands for extracting conserved regions from PhastCons conservation tracks

Commands for extracting conserved regions from 100-way PhastCons conservation tracks. Then BLAST can be used to extract orthologous regions from genome of interest for as many regions as possible.

# download the human gene annotations
wget http://hgdownload.cse.ucsc.edu/goldenPath/hg38/database/refGene.txt.gz

# convert human gene annotations to GTF file format
zcat refGene.txt.gz | cut -f 2- | genePredToGtf -utr file stdin stdout > refGene.gtf

# extract exon features from GTF file
@darencard
darencard / basespace_quickstart.md
Created October 3, 2018 16:40
Installing, authenticating, and downloading using BaseSpace CLI

Installing, authenticating, and downloading using BaseSpace CLI

Installation on Mac computer

  1. Install BaseSpace CLI to $HOME/bin directory and make executable.
wget "https://api.bintray.com/content/basespace/BaseSpaceCLI-EarlyAccess-BIN/latest/\$latest/amd64-osx/bs?bt_package=latest" \
-O $HOME/bin/bs
chmod u+x $HOME/bin/bs
@darencard
darencard / entware_synology.md
Last active September 25, 2024 05:17
Setting up and using Entware on Synology device
@darencard
darencard / scrolling_DNA.md
Last active January 12, 2021 12:24
Creating a scrolling DNA sequence visualization

Creating a scrolling DNA sequence visualization

Are you a scientist working in genomics? Have you ever given an interview to your university communications staff or local press? Did you ever find yourself wishing you could have a continuously scrolling nucleotide sequence running in the background during one of these interviews? Well look no further, because here is exactly what you need to create such an effect, which will really wow those who watch your interview.

We will create two scripts - one that creates a random string of nucleotides and one that colors each nucleotide a different color. Here is the first script, in python, named random_seq.py.

#!/usr/bin/env python

import random
@darencard
darencard / CDS_extract.md
Last active March 28, 2024 13:30
Extracting spliced sequences (e.g., CDS) from GFF files

Extracting spliced sequences (e.g., CDS) from GFF files

GFF is a common format for storing genetic feature annotations. In the case of gene annotations, subsets of elements are split over multiple lines, as things like exons and CDS features will have gaps based on the full genome sequence. Therefore, while it is easy to extract exon and CDS lines, it can be difficult to associate them together based on a parent (e.g., transcript) ID and perform downstream operations. Even extracting the full CDS sequence using a GFF file can be tricky for this reason, even though it seems trivial.

Here we'll overcome this difficulty using the gffread tool. Installation is pretty easy and is documented in the GitHub README. gffread has a lot of options, but here we'll just document one that extracts the spliced CDS for each GFF transcript (-x option). Note that you can do the same thing for exons (-w option) and can also produce the protein sequence (-y option).

Let's extra

@darencard
darencard / orthomcl_tutorial.md
Last active March 15, 2023 13:31
Running OrthoMCL on a set of protein annotations

Running OrthoMCL on a set of protein annotations from various species

OrthoMCL is the leading piece of software for inferring orthologs across several organisms. In this tutorial I will provide detailed instructions for running a set of protein annotations through OrthoMCL.

Software and Data

  1. OrthoMCL, and it's dependencies, must be installed. Detailed information on this tool and its installation can be found here. I actually used a slightly modified version of OrthoMCL that was made available by the author of the orthomcl-pipeline (see below). There isn't much details on the ways this is different from the existing OrthoMCL, but this is available here.
  2. orthmcl-pipeline must also be installed, as this is how we will automate the OrthoMCL process. Detailed information on this tool and its installation can be found [here](https
@darencard
darencard / gene_structure_stats.md
Last active April 18, 2023 13:35
Script to produce estimates of gene structure

Please see the most up-to-date version of this protocol on my blog at https://darencard.net/blog/.

Inferring the structure of gene annotations

When annotating genomes it is often desireable to know the overall structure of genes, including information like exon and intron lengths among other metrics. Here is a program genestats that will calculate such measures for a user.

#!/usr/bin/env bash

usage()