Skip to content

Instantly share code, notes, and snippets.

@nikhilRP
Created March 5, 2015 23:19
Show Gist options
  • Save nikhilRP/aa0bea5398e6aa029acd to your computer and use it in GitHub Desktop.
Save nikhilRP/aa0bea5398e6aa029acd to your computer and use it in GitHub Desktop.
Shell script to download and transfrom ENCODE files to ADAM format
# Files.txt contains URLs for the files
# Make sure you set SPARK_HOME
while read line; do
url=$line
filename=$(basename "$url")
wget "$url"
hadoop fs -put $filename /user/mapr/encoded/
./../adam/bin/adam-submit transform /user/mapr/encoded/$filename /user/mapr/encoded/"${filename/.bam/.adam}"
hadoop fs -rm /user/mapr/encoded/$filename
rm $filename
done < files.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment