Skip to content

Commit cbc4964

Browse files
committed
Cleanup
1 parent 5fefd2e commit cbc4964

34 files changed

+82
-29
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ Tests
3333

3434
Usages
3535
------
36-
Used in the following projects:
36+
Used in the following projects:
37+
3738
* [SPAN](https://github.com/JetBrains-Research/span) Semi-supervised Peak Analyzer
3839
* [JBR](https://github.com/JetBrains-Research/jbr) JBR Genome Browser
3940
* [FARM](https://github.com/JetBrains-Research/fishbone) hierarchical association rule mining and visualization method

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ if (rootProject == project) {
9292
}
9393
}
9494
}
95+
9596
private String settingsFolder(final String propertyName, final String folderName) {
9697
if (!System.hasProperty(propertyName)) {
9798
return "${rootProject.buildDir}/.tests/$folderName"

src/main/kotlin/org/jetbrains/bio/BioinfToolsCLA.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ object BioinfToolsCLA {
9090
/**
9191
* Configure logging to console / file. Returns path to log file.
9292
*/
93-
internal fun configureLogging(quiet: Boolean, debug: Boolean) {
93+
internal fun configureLogging(quiet: Boolean, debug: Boolean) {
9494
if (quiet) {
9595
Logs.quiet()
9696
}

src/main/kotlin/org/jetbrains/bio/dataframe/DataFrameMapper.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ object DataFrameMappers {
8686
val witness = values.asBooleanArray()
8787
column.wrap(BitterSet(witness.size) { witness[it] })
8888
}
89+
8990
is StringColumn -> column.wrap(values.asStringArray())
9091
else -> error("unsupported column type: ${column.javaClass.canonicalName}")
9192
}
@@ -108,6 +109,7 @@ object DataFrameMappers {
108109
is DoubleColumn -> writer.write(column.label, column.data)
109110
is BooleanColumn -> writer.write(
110111
column.label, with(column.data) { BooleanArray(size()) { get(it) } })
112+
111113
is StringColumn -> writer.write(column.label, column.data)
112114
else -> error("unsupported column type: ${column.javaClass.canonicalName}")
113115
}

src/main/kotlin/org/jetbrains/bio/dataframe/DataFramePredicates.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,14 @@ fun all(pf: RowPredicateFactory, vararg rest: RowPredicateFactory): RowPredicate
8383
val p1 = pfs[1](df)
8484
IntPredicate { p0.test(it) && p1.test(it) }
8585
}
86+
8687
3 -> RowPredicateFactory { df ->
8788
val p0 = pfs[0](df)
8889
val p1 = pfs[1](df)
8990
val p2 = pfs[2](df)
9091
IntPredicate { p0.test(it) && p1.test(it) && p2.test(it) }
9192
}
93+
9294
else -> RowPredicateFactory { df ->
9395
// XXX we could optimize it by processing pfs in threes.
9496
val ps = pfs.map { it(df) }

src/main/kotlin/org/jetbrains/bio/genome/Ensembl.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ class GtfReader(val reader: BufferedReader, val genome: Genome) {
158158
// just not to write long if condition:
159159
"transcript", "exon", "CDS", "start_codon", "three_prime_utr" -> { /* noop */
160160
}
161+
161162
else -> return type
162163
}
163164

@@ -188,15 +189,19 @@ class GtfReader(val reader: BufferedReader, val genome: Genome) {
188189
"exon" -> {
189190
transcriptInfo.exons.add(location)
190191
}
192+
191193
"CDS" -> {
192194
transcriptInfo.cds.add(location)
193195
}
196+
194197
"transcript" -> {
195198
transcriptInfo.transcript = location
196199
}
200+
197201
"three_prime_utr" -> {
198202
transcriptInfo.utr3.add(location)
199203
}
204+
200205
"start_codon" -> {
201206
// Used only for data validation
202207
if (transcriptInfo.startCodon == -1) {

src/main/kotlin/org/jetbrains/bio/genome/Genome.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ class Genome private constructor(
9999
gtfPath.name.endsWith(".gtf.gz") -> {
100100
gtfPath.name.subSequence(0, gtfPath.name.length - ".gtf.gz".length)
101101
}
102+
102103
gtfPath.extension == "gtf" -> gtfPath.stem
103104
else -> error("Unsupported GTF path: $gtfPath")
104105
}
@@ -245,7 +246,7 @@ class Genome private constructor(
245246
companion object {
246247
const val TEST_ORGANISM_BUILD = "to1"
247248

248-
internal val LOG = LoggerFactory.getLogger(Genome::class.java)
249+
internal val LOG = LoggerFactory.getLogger(Genome::class.java)
249250

250251
/** Use cache to avoid extra chrom.sizes loading. */
251252
private val CACHE = Maps.newConcurrentMap<String, Genome>()
@@ -278,6 +279,7 @@ class Genome private constructor(
278279
"<n/a>", "<n/a>", "<n/a>", "<n/a>", "<n/a>",
279280
null, "<n/a>", null
280281
)
282+
281283
else -> {
282284
if (!AnnotationsConfigLoader.initialized) {
283285
// Init with default settings only if not initialized by user before us

src/main/kotlin/org/jetbrains/bio/genome/GenomeQuery.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class GenomeQuery(val genome: Genome, vararg names: String) {
6666
override fun hashCode() = Objects.hash(build, restriction)
6767

6868
companion object {
69-
internal val LOG = LoggerFactory.getLogger(GenomeQuery::class.java)
69+
internal val LOG = LoggerFactory.getLogger(GenomeQuery::class.java)
7070

7171
/**
7272
* Parses [String] as genome with possible custom chromosomes set.

src/main/kotlin/org/jetbrains/bio/genome/Transcripts.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,15 @@ object Transcripts {
336336
AssociationStrategy.SINGLE -> associatedTranscriptsSingle(
337337
location, limit, codingOnly
338338
)
339+
339340
AssociationStrategy.TWO -> associatedTranscriptsTwo(
340341
location, limit, codingOnly
341342
)
343+
342344
AssociationStrategy.BASAL_PLUS_EXT -> associatedTranscriptsPlus(
343345
location, codingOnly = codingOnly, distal = limit
344346
)
347+
345348
AssociationStrategy.MULTIPLE -> associatedTranscriptsMultiple(
346349
location, codingOnly = codingOnly, limit = limit
347350
)

src/main/kotlin/org/jetbrains/bio/genome/containers/intersection/IntersectionInfo.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,14 @@ data class IntersectionInfo(
8383
0 -> {
8484
colNames = csvRecord!!.toList().subList(2, csvRecord.size())
8585
}
86+
8687
1 -> {
8788
requireNotNull(colNames)
8889
colsMergedLociNumber = IntArray(colNames!!.size) { i ->
8990
csvRecord.get(i + 2).toInt()
9091
}
9192
}
93+
9294
else -> {
9395
val records = csvRecord.toList()
9496
val rowValues = DoubleArray(colNames!!.size)

0 commit comments

Comments
 (0)