Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helper scripts to run an ADAM Console. #231

Merged
merged 1 commit into from
Apr 29, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions scripts/adam-console.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT_ROOT="$DIR/.."
VERSION=$(grep "<version>" "$PROJECT_ROOT/pom.xml" | head -2 | tail -1 | sed 's/ *<version>//g' | sed 's/<\/version>//g')
ADAM_JAR=$PROJECT_ROOT/adam-cli/target/adam-$VERSION.jar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also just do ADAM_JAR=$PROJECT_ROOT/adam-cli/target/adam-?.?.?-SNAPSHOT.jar instead of grabbing the version from the pom file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but I've noticed that my target subdirectory accumulates multiple versions as time goes on.


SPARK_CLASSPATH=$ADAM_JAR spark-shell -i:$DIR/scala-console.scala
15 changes: 15 additions & 0 deletions scripts/scala-console.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import org.bdgenomics.adam.avro.ADAMRecord
import org.bdgenomics.adam.avro.ADAMNucleotideContigFragment
import org.bdgenomics.adam.avro.ADAMPileup
import org.bdgenomics.adam.avro.ADAMNestedPileup
import org.bdgenomics.adam.avro.ADAMContig
import org.bdgenomics.adam.avro.ADAMVariant
import org.bdgenomics.adam.avro.VariantCallingAnnotations
import org.bdgenomics.adam.avro.ADAMGenotype
import org.bdgenomics.adam.avro.VariantEffect
import org.bdgenomics.adam.avro.ADAMDatabaseVariantAnnotation
import org.apache.spark.rdd.RDD
import org.bdgenomics.adam.rdd.ADAMContext
import org.bdgenomics.adam.rdd.ADAMContext._
println("\nYou can call ADAMContext methods on sc")
println("Load a file using: sc.adamLoad(\"<Path to file>\");")