Skip to content

Instantly share code, notes, and snippets.

@clintval
Created March 19, 2018 17:39
Show Gist options
  • Select an option

  • Save clintval/3d9d92a576d4b9eff7d73452f92783fe to your computer and use it in GitHub Desktop.

Select an option

Save clintval/3d9d92a576d4b9eff7d73452f92783fe to your computer and use it in GitHub Desktop.
Grab karyotype assembly from a reference genome
# Pipe in the karyotype chromosomes
# Prefix each chromosome name with `chr` if necessary
# Slice the contigs from the source indexed FASTA with samtools
# Output to file
build="${build}"
echo {1..20} X Y M \
| xargs printf -- 'chr%s ' \
| xargs samtools faidx "${build}".fa \
> "${build}".karyotype.fa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment