Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
ngs_tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bioinfo
ngs_tools
Commits
5a33481c
Commit
5a33481c
authored
9 years ago
by
Holger Brandl
Browse files
Options
Downloads
Patches
Plain Diff
improved genome guessing
parent
e17cdaf8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dge_workflow/dge_utils.sh
+13
-2
13 additions, 2 deletions
dge_workflow/dge_utils.sh
misc/guess_species_from_gtf.scalah
+37
-0
37 additions, 0 deletions
misc/guess_species_from_gtf.scalah
with
50 additions
and
2 deletions
dge_workflow/dge_utils.sh
+
13
−
2
View file @
5a33481c
...
...
@@ -384,12 +384,23 @@ mysub "${project}__cuffdiff" "$cdCmd" -q long -n 4 -R span[hosts=1] | blockScri
tmpDbDir
=
$(
mktemp
-d
)
cp
-r
.
$tmpDbDir
## todo remove this hack
genome
=
$(
echo
$gtfFile
|
cut
-f8
-d
'/'
|
tr
'[:upper:]'
'[:lower:]'
)
;
echo
"genome is
$genome
"
#
genome=$(echo $gtfFile | cut -f8 -d'/' | tr '[:upper:]' '[:lower:]'); echo "genome is $genome"
## make sure to use temp-r to avoid file locking problems
#export R_LIBS=/tmp/r_index
genome
=
$(
scala
-e
'
val gtfFile = args(0); //val gtfFile="mm10_igenomes_pc.gtf"
val pattern = "mm10|mm9|hg19|zv9".r
println(pattern.findFirstIn(gtfFile).getOrElse(""))
'
$(
readlink
-f
$gtfFile
)
)
echo
$genome
echo
'
require(cummeRbund)
dbDir=commandArgs(T)[1]
...
...
This diff is collapsed.
Click to expand it.
misc/guess_species_from_gtf.scalah
0 → 100755
+
37
−
0
View file @
5a33481c
#!/bin/sh
exec
scalas
"
$0
"
"
$@
"
!
#
/
**
Work
in
progress: Guess the species from a gtf file. By name first and
then
by file content. A more simplistic approach is already implementd
in
dge_workflow/dge_utils.sh
*
/
import java.io.File
import scala.io.Source
// http://alvinalexander.com/scala/scala-shell-script-command-line-arguments-args
val gtfFile
=
args
(
1
)
//val
gtfFile
=
"mm10_igenomes_pc.gtf"
val pattern
=
"mm10|mm9|h19|zv9"
.r
val genomeByName
=
pattern.findFirstIn
(
gtfFile
)
if
(
genomeByName.isEmpty
)
{
System.exit
(
1
)
}
def guessFromContent
(
gtfFile: File
)
: Option[String]
=
{
// Source.fromString
(
s
"grep ENSMUSG
$gtfFile
| "
!!)
.getLines
()
.hasNext
// Bash.evalCapture
(
s
"grep ENSMUSG
$gtfFile
| wc -l"
)
if
(
Source.fromFile
(
gtfFile
)
.getLines
()
.exists
(
_.contains
(
"ENSMUSG"
)))
return
Some
(
"mouse"
)
if
(
Source.fromFile
(
gtfFile
)
.getLines
()
.exists
(
_.contains
(
"ENSCAFG"
)))
return
Some
(
"dog"
)
None
}
genomeByName.get match
{
case
"mm9"
=>
}
println
(
genomeByName
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment