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
53855f50
Commit
53855f50
authored
Nov 12, 2014
by
Peter van 't Hof
Browse files
Added fillAllele function
parent
20c25a0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/util/VcfUtils.scala
View file @
53855f50
...
...
@@ -9,11 +9,15 @@ object VcfUtils {
* Return longest allele of VariantContext.
*
* @param vcfRecord record to check
* @return allele with most nucleotides
* @return allele with most nucleotides
*/
def
getLongestAllele
(
vcfRecord
:
VariantContext
)
=
{
val
alleles
=
vcfRecord
.
getAlleles
val
longestAlleleId
=
alleles
.
map
(
_
.
getBases
.
length
).
zipWithIndex
.
maxBy
(
_
.
_1
).
_2
alleles
(
longestAlleleId
)
}
def
fillAllele
(
bases
:
String
,
newSize
:
Int
,
fillWith
:
Char
=
'N'
)
:
String
=
{
bases
+
(
Array
.
fill
[
Char
](
newSize
-
bases
.
size
)(
fillWith
)).
mkString
}
}
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