Created
February 21, 2021 18:56
-
-
Save chasemc/0674866b46ced0ad8c5b350f325b80ec to your computer and use it in GitHub Desktop.
Extract genomic_accessions and lengths from "ftp.ncbi.nlm.nih.gov/genomes............._assembly_report.txt"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
curl -s $1 |\ | |
sed -ne '/# Sequence-Name\tSequence-Role\tAssigned-Molecule\tAssigned-Molecule-Location\/Type\tGenBank-Accn\tRelationship\tRefSeq-Accn\tAssembly-Unit\tSequence-Length\tUCSC-style-name/,$ p' |\ | |
awk -F"\t" 'NR==1 {for (i=1; i<=NF; i++) {f[$i] = i}}{ print $(f["RefSeq-Accn"]), $(f["Sequence-Length"])}' |\ | |
sed 1d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
example: