Skip to content

Commit

Permalink
separate mark for contaminations, refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
gnefedev committed Nov 8, 2023
1 parent 0fe2cbb commit 970c8f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import com.milaboratory.mixcr.basictypes.tag.TagsInfo
import com.milaboratory.mixcr.cli.CommandExportCloneGroupsParams.SortChainsBy
import com.milaboratory.mixcr.cli.CommonDescriptions.DEFAULT_VALUE_FROM_PRESET
import com.milaboratory.mixcr.clonegrouping.CellType
import com.milaboratory.mixcr.clonegrouping.CloneGrouper
import com.milaboratory.mixcr.export.CloneGroup
import com.milaboratory.mixcr.export.CloneGroupFieldsExtractorsFactory
import com.milaboratory.mixcr.export.InfoWriter
Expand Down Expand Up @@ -197,7 +196,7 @@ object CommandExportCloneGroups {
sortChainsBy: SortChainsBy,
tagsInfo: TagsInfo
): List<CloneGroup> = recalculatedClones
.filter { it.group != CloneGrouper.undefinedGroup }
.filter { it.groupIsDefined }
.groupBy { it.group!! }
.map { (groupId, clones) ->
val clonesGroupedByChains = clones.groupBy { it.chains }
Expand Down
24 changes: 3 additions & 21 deletions src/main/kotlin/com/milaboratory/mixcr/cli/CommandGroupClones.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import com.milaboratory.mixcr.basictypes.MiXCRHeader
import com.milaboratory.mixcr.basictypes.VDJCAlignments
import com.milaboratory.mixcr.basictypes.tag.TagType
import com.milaboratory.mixcr.clonegrouping.CloneGroupingParams.Companion.mkGrouper
import com.milaboratory.mixcr.clonegrouping.SingleCellGroupingParamsByOverlappingCellIds
import com.milaboratory.mixcr.presets.MiXCRCommandDescriptor
import com.milaboratory.mixcr.presets.MiXCRParamsBundle
import com.milaboratory.mixcr.util.Concurrency
Expand Down Expand Up @@ -174,24 +173,7 @@ object CommandGroupClones {
}

val paramsSpec = resetPreset.overridePreset(header.paramsSpec)
// val (_, cmdParams) = paramsResolver.resolve(paramsSpec)
val (_, cmdParams) = 1 to CommandGroupClonesParams(
SingleCellGroupingParamsByOverlappingCellIds(
minOverlapForSmaller = SingleCellGroupingParamsByOverlappingCellIds.Threshold(
0.8,
SingleCellGroupingParamsByOverlappingCellIds.Threshold.RoundingMode.UP
),
minOverlapForBigger = SingleCellGroupingParamsByOverlappingCellIds.Threshold(
0.2,
SingleCellGroupingParamsByOverlappingCellIds.Threshold.RoundingMode.UP
),
nonFunctional = SingleCellGroupingParamsByOverlappingCellIds.ForNonFunctional.DontProcess,
thresholdForAssigningLeftoverCells = SingleCellGroupingParamsByOverlappingCellIds.Threshold(
0.6,
SingleCellGroupingParamsByOverlappingCellIds.Threshold.RoundingMode.DOWN
)
)
)
val (_, cmdParams) = paramsResolver.resolve(paramsSpec)


reportBuilder.setStartMillis(System.currentTimeMillis())
Expand All @@ -204,12 +186,12 @@ object CommandGroupClones {
input.cloneSetInfo.assemblingFeatures
)
SmartProgressReporter.startProgressReport(grouper)
val grouppedClones = grouper.groupClones(input.clones)
val groupedClones = grouper.groupClones(input.clones)
reportBuilder.grouperReport = grouper.getReport()

logger.progress { "Resorting and recalculating ranks" }
return CloneSet.Builder(
grouppedClones,
groupedClones,
input.usedGenes,
input.header
.copy(calculatedCloneGroups = true)
Expand Down

0 comments on commit 970c8f6

Please sign in to comment.