Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
2fc72f69
Commit
2fc72f69
authored
Jan 26, 2017
by
Sander Bollen
Committed by
GitHub
Jan 26, 2017
Browse files
Merge pull request #12 from biopet/fix-BIOPET-544
Replace ID with a file argument
parents
d36878da
c3a9e217
Changes
3
Hide whitespace changes
Inline
Side-by-side
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
View file @
2fc72f69
...
...
@@ -120,7 +120,7 @@ trait BiopetQScript extends Configurable with GatkLogging { qscript: QScript =>
val
className
=
if
(
f
.
getClass
.
isAnonymousClass
)
f
.
getClass
.
getSuperclass
.
getSimpleName
else
f
.
getClass
.
getSimpleName
BiopetQScript
.
safeOutputs
(
f
)
match
{
case
Some
(
o
)
=>
f
.
jobOutputFile
=
new
File
(
o
.
head
.
getAbsoluteFile
.
getParent
,
"."
+
f
.
firstOutput
.
getName
+
"."
+
className
+
".out"
)
case
_
=>
f
.
jobOutputFile
=
new
File
(
"./stdout"
)
// Line is here for test backup
case
_
=>
f
.
jobOutputFile
=
new
File
(
"./stdout"
)
// Line is here for test backup
}
})
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/DownloadNcbiAssembly.scala
View file @
2fc72f69
...
...
@@ -11,7 +11,7 @@ import scala.io.Source
*/
object
DownloadNcbiAssembly
extends
ToolCommand
{
case
class
Args
(
assembly
Id
:
String
=
null
,
case
class
Args
(
assembly
Report
:
File
=
null
,
outputFile
:
File
=
null
,
reportFile
:
Option
[
File
]
=
None
,
contigNameHeader
:
Option
[
String
]
=
None
,
...
...
@@ -19,8 +19,8 @@ object DownloadNcbiAssembly extends ToolCommand {
mustNotHave
:
List
[(
String
,
String
)]
=
List
())
extends
AbstractArgs
class
OptParser
extends
AbstractOptParser
{
opt
[
String
](
'a'
,
"assembly
id
"
)
required
()
unbounded
()
valueName
"<file>"
action
{
(
x
,
c
)
=>
c
.
copy
(
assembly
Id
=
x
)
opt
[
File
](
'a'
,
"assembly
_report
"
)
required
()
unbounded
()
valueName
"<file>"
action
{
(
x
,
c
)
=>
c
.
copy
(
assembly
Report
=
x
)
}
text
"refseq ID from NCBI"
opt
[
File
](
'o'
,
"output"
)
required
()
unbounded
()
valueName
"<file>"
action
{
(
x
,
c
)
=>
c
.
copy
(
outputFile
=
x
)
...
...
@@ -52,8 +52,8 @@ object DownloadNcbiAssembly extends ToolCommand {
val
argsParser
=
new
OptParser
val
cmdargs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
logger
.
info
(
s
"Reading ${cmdargs.assembly
Id} from NCBI
"
)
val
reader
=
Source
.
from
URL
(
s
"ftp://ftp.ncbi.nlm.nih.gov/genomes/ASSEMBLY_REPORTS/All/${cmdargs.assemblyId}.assembly.txt"
)
logger
.
info
(
s
"Reading ${cmdargs.assembly
Report}
"
)
val
reader
=
Source
.
from
File
(
cmdargs
.
assemblyReport
)
val
assamblyReport
=
reader
.
getLines
().
toList
reader
.
close
()
cmdargs
.
reportFile
.
foreach
{
file
=>
...
...
biopet-tools/src/test/scala/nl/lumc/sasc/biopet/tools/DownloadNcbiAssemblyTest.scala
View file @
2fc72f69
...
...
@@ -23,7 +23,7 @@ class DownloadNcbiAssemblyTest extends TestNGSuite with Matchers {
val
outputReport
=
File
.
createTempFile
(
"test."
,
".report"
)
output
.
deleteOnExit
()
outputReport
.
deleteOnExit
()
DownloadNcbiAssembly
.
main
(
Array
(
"-a"
,
"GCF_000844745.1"
,
DownloadNcbiAssembly
.
main
(
Array
(
"-a"
,
new
File
(
resourcePath
(
"/GCF_000844745.1.report"
)).
getAbsolutePath
,
"-o"
,
output
.
getAbsolutePath
,
"--report"
,
outputReport
.
getAbsolutePath
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment