Mercurial > repos > timpalpant > java_genomics_toolkit
comparison src/edu/unc/genomics/WigFileConverter.java @ 2:e16016635b2a
Uploaded
| author | timpalpant |
|---|---|
| date | Mon, 13 Feb 2012 22:12:06 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1:a54db233ee3d | 2:e16016635b2a |
|---|---|
| 1 package edu.unc.genomics; | |
| 2 | |
| 3 import java.io.IOException; | |
| 4 import java.nio.file.Path; | |
| 5 | |
| 6 import com.beust.jcommander.IStringConverter; | |
| 7 import com.beust.jcommander.ParameterException; | |
| 8 | |
| 9 import edu.unc.genomics.io.WigFile; | |
| 10 import edu.unc.genomics.io.WigFileException; | |
| 11 | |
| 12 /** | |
| 13 * @author timpalpant | |
| 14 * | |
| 15 */ | |
| 16 public class WigFileConverter implements IStringConverter<WigFile> { | |
| 17 | |
| 18 @Override | |
| 19 public WigFile convert(String value) throws ParameterException { | |
| 20 PathConverter converter = new PathConverter(); | |
| 21 Path p = converter.convert(value); | |
| 22 try { | |
| 23 return WigFile.autodetect(p); | |
| 24 } catch (WigFileException | IOException e) { | |
| 25 throw new ParameterException("Error autodetecting and initializing BigWig/Wig file"); | |
| 26 } | |
| 27 } | |
| 28 | |
| 29 } |
