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

java.io.FileNotFoundException when file exists #1385

Closed
akmorrow13 opened this issue Feb 8, 2017 · 5 comments
Closed

java.io.FileNotFoundException when file exists #1385

akmorrow13 opened this issue Feb 8, 2017 · 5 comments

Comments

@akmorrow13
Copy link
Contributor

@akmorrow13 akmorrow13 commented Feb 8, 2017

I have been having issues reading hdfs files via sc.loadFeatures() and sc.loadAlignments() in ADAMContext. However, I am able to load in the same file location using sc.textFile().

@fnothaft
Copy link
Member

@fnothaft fnothaft commented Feb 8, 2017

Hi @akmorrow13! Could you post a stack trace?

@akmorrow13
Copy link
Contributor Author

@akmorrow13 akmorrow13 commented Feb 8, 2017

scala> import org.bdgenomics.adam.rdd.ADAMContext._
import org.bdgenomics.adam.rdd.ADAMContext._

scala> val f = sc.loadFeatures("hdfs://amp-bdg-master.amplab.net:8020/user/akmorrow/featuresOutput_GM12878.adam")
java.io.FileNotFoundException: Couldn't find any files matching hdfs://amp-bdg-master.amplab.net:8020/user/akmorrow/featuresOutput_GM12878.adam
        at org.bdgenomics.adam.rdd.ADAMContext.getFsAndFilesWithFilter(ADAMContext.scala:477)
        at org.bdgenomics.adam.rdd.ADAMContext.loadAvroSequences(ADAMContext.scala:290)
        at org.bdgenomics.adam.rdd.ADAMContext.loadParquetFeatures(ADAMContext.scala:1223)
        at org.bdgenomics.adam.rdd.ADAMContext.loadFeatures(ADAMContext.scala:1372)
        at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:30)
        at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:35)
        at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:37)
        at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:39)
        at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:41)
        at $iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:43)
        at $iwC$$iwC$$iwC$$iwC.<init>(<console>:45)
        at $iwC$$iwC$$iwC.<init>(<console>:47)
        at $iwC$$iwC.<init>(<console>:49)
        at $iwC.<init>(<console>:51)
        at <init>(<console>:53)
        at .<init>(<console>:57)
        at .<clinit>(<console>)
        at .<init>(<console>:7)
        at .<clinit>(<console>)
        at $print(<console>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.spark.repl.SparkIMain$ReadEvalPrint.call(SparkIMain.scala:1045)
        at org.apache.spark.repl.SparkIMain$Request.loadAndRun(SparkIMain.scala:1326)
        at org.apache.spark.repl.SparkIMain.loadAndRunReq$1(SparkIMain.scala:821)
        at org.apache.spark.repl.SparkIMain.interpret(SparkIMain.scala:852)
        at org.apache.spark.repl.SparkIMain.interpret(SparkIMain.scala:800)
        at org.apache.spark.repl.SparkILoop.reallyInterpret$1(SparkILoop.scala:857)
        at org.apache.spark.repl.SparkILoop.interpretStartingWith(SparkILoop.scala:902)
        at org.apache.spark.repl.SparkILoop.command(SparkILoop.scala:814)
        at org.apache.spark.repl.SparkILoop.processLine$1(SparkILoop.scala:657)
        at org.apache.spark.repl.SparkILoop.innerLoop$1(SparkILoop.scala:665)
        at org.apache.spark.repl.SparkILoop.org$apache$spark$repl$SparkILoop$$loop(SparkILoop.scala:670)
        at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1.apply$mcZ$sp(SparkILoop.scala:997)
        at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1.apply(SparkILoop.scala:945)
        at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1.apply(SparkILoop.scala:945)
        at scala.tools.nsc.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:135)
        at org.apache.spark.repl.SparkILoop.org$apache$spark$repl$SparkILoop$$process(SparkILoop.scala:945)
        at org.apache.spark.repl.SparkILoop.process(SparkILoop.scala:1064)
        at org.apache.spark.repl.Main$.main(Main.scala:31)
        at org.apache.spark.repl.Main.main(Main.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:731)
        at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:181)
        at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:206)
        at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121)
        at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)


scala> val s = sc.textFile("hdfs://amp-bdg-master.amplab.net:8020/user/akmorrow/featuresOutput_GM12878.adam")
s: org.apache.spark.rdd.RDD[String] = hdfs://amp-bdg-master.amplab.net:8020/user/akmorrow/featuresOutput_GM12878.adam MapPartitionsRDD[1] at textFile at <console>:30

scala> println(s.first)
chr1    90600   91600   sequence_feature        1.0     +

@fnothaft
Copy link
Member

@fnothaft fnothaft commented Feb 8, 2017

How are you saving that file? The short bit here is that we're somewhat lazy about autodetecting file types and we just use the file extension. So if you save reads as a SAM file but name the path "anythingnotendingindotsam.adam" or if you save features as a BED file but name the path "anythingnotendingindotbednarrowpeakgtfgffetc.adam", we'll try to load it as a Parquet file, in which case we expect to see other metadata files around.

@akmorrow13
Copy link
Contributor Author

@akmorrow13 akmorrow13 commented Feb 8, 2017

        new FeatureRDD(rdd, l.sequences)
          .saveAsBed(s"featuresOutput_${cellType._1}.adam")

Lol thats it, thanks @fnothaft!

@akmorrow13 akmorrow13 closed this Feb 8, 2017
@fnothaft
Copy link
Member

@fnothaft fnothaft commented Feb 8, 2017

No sweat! I like straightforward tickets!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.