Skip to content
This repository was archived by the owner on Dec 18, 2020. It is now read-only.

Project 1: Get IDs

Arjun Prasad edited this page Nov 23, 2020 · 1 revision

This was done for you, and a list of IDs should be in your $HOME/project1/step1 directory

The goal is to get the data for the Acinetobacter baumanii isolates the Antibiograms for Singaporean patient isolates (Supplementary Figure 6). Unfortunately only internal identifiers are used in the spreadsheet so we have to find a way to identify the SRA runs associated with those internal identifiers.

Here is the procedure we used to get to the data; there may be other quicker ways to get there, but this is how we investigated and found the sequences in Supplementary Figure 6.

  1. Copy and paste column 1 into a file singapore_sample_names.txt
  2. Search NCBI BioProject and found a BioProject that matched the paper PRJEB31632. Searching BioSample we found the internal identifiers so we downloaded the BioSample matches in XML format.
  3. Get list of accessions:
    1. Download XML (Send to → file → format (full text(XML)) from BioSample
    2. Upload XML file to https://www.convertcsv.com/xml-to-csv.htm and download resulting CSV file, save it as biosample_result.csv
  4. Copy biosample_result.csv to your VM
    • Upload it to your bucket using the web interface
mkdir project1
cd project1
mkdir step1
cd step1
    # copy in the biosample_result.csv
    gsutil cp gs://pathogen-workhop-aprasad/project1/step1/biosample_result.csv $HOME/project1/step1

    # copy the column of sample names from the supplimentary data 6 spreadsheet to singapore_sample_names.txt
    fgrep -f singapore_sample_names.txt biosample_result.csv | cut -f 8,9 -d, | tr ',' '\t' > singapore_samples_sra.txt

    # use NCBI E-utils to get the run accessions
    cat <<'END' > get_err_accession.sh
    > singapore_samples_srafull.txt
    date
    while read -u 10 acc name
    do
        ERR=`esearch -db sra -query $acc | efetch -format native | perl -ne 'm/<RUN accession="(\w+)"/; print "$1\n"' | tail -1`
        echo $name$'\t'$acc$'\t'$ERR >> singapore_samples_srafull.txt
    done 10< singapore_samples_sra.txt
    date
END
    bash -x get_err_accession.sh 2>&1 | tee get_err_accession.out

Clone this wiki locally