Skip to content

Commit f3ab5c8

Browse files
committed
fixes, bumps from Version: 0.99.6 to Version: 0.99.7
1 parent 9999a56 commit f3ab5c8

11 files changed

Lines changed: 217 additions & 198 deletions

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: MSstatsConvert
22
Title: Import Data from Various Mass Spectrometry Signal Processing Tools to MSstats Format
3-
Version: 0.99.6
3+
Version: 0.99.7
44
Authors@R: c(
55
person("Mateusz", "Staniak", email = "mtst@mstaniak.pl", role = c("aut","cre")),
66
person("Meena", "Choi", email = "mnchoi67@gmail.com", role = "aut"),
Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,38 @@
11
data_invalid = data.table::data.table(ProteinName = letters[1:10],
2-
PeptideSequence = LETTERS[1:10])
2+
PeptideSequence = LETTERS[1:10])
33
data_no_channel = data.table::data.table(ProteinName = letters[1:10],
44
PeptideSequence = LETTERS[1:10],
5+
PrecursorCharge = 1,
6+
FragmentIon = NA,
7+
ProductCharge = NA,
8+
Run = 1,
9+
Condition = 1,
10+
BioReplicate = 1,
11+
Intensity = 0.1,
512
IsotopeLabelType = "L")
613
data_no_channel_LH = data.table::data.table(ProteinName = letters[1:10],
714
PeptideSequence = LETTERS[1:10],
815
IsotopeLabelType = rep(c("L", "H"),
916
each = 5))
1017
data_channel = data.table::data.table(ProteinName = letters[1:10],
1118
PeptideSequence = LETTERS[1:10],
19+
PrecursorCharge = 1,
20+
PSM = "1",
21+
Mixture = 1,
22+
TechRepMixture = 1,
23+
Run = 1,
24+
BioReplicate = 1,
25+
Condition = 1,
1226
Channel = paste0("A", 1:10))
1327
tmt_object = MSstatsConvert:::.MSstatsFormat(data_channel)
1428
labelfree_object = MSstatsConvert:::.MSstatsFormat(data_no_channel)
1529
labelled_object = MSstatsConvert:::.MSstatsFormat(data_no_channel_LH)
1630

1731
# Has the right format for MSstats data
18-
tinytest::expect_true(is(labelled_object, "MSstatsValidated"))
19-
tinytest::expect_true(is(labelfree_object, "MSstatsValidated"))
20-
tinytest::expect_true(is(tmt_object, "MSstatsValidated"))
32+
expect_true(is(labelled_object, "MSstatsValidated"))
33+
expect_true(is(labelfree_object, "MSstatsValidated"))
34+
expect_true(is(tmt_object, "MSstatsValidated"))
2135
# Inherits after data.frame
22-
tinytest::expect_true(is(labelled_object, "data.frame"))
23-
tinytest::expect_true(is(labelfree_object, "data.frame"))
24-
tinytest::expect_true(is(tmt_object, "data.frame"))
36+
expect_true(is(labelled_object, "data.frame"))
37+
expect_true(is(labelfree_object, "data.frame"))
38+
expect_true(is(tmt_object, "data.frame"))

inst/tinytest/test_annotation.R

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ annotation_4 = data.table::data.table(
4040
## No annotation - return a subset of original data
4141
unique_runs = unique(dataset)
4242
unique_runs$Run = as.character(unique_runs$Run)
43-
tinytest::expect_equal(MSstatsConvert:::MSstatsMakeAnnotation(dataset, NULL),
44-
unique_runs)
45-
## No additional information - return NULL
46-
tinytest::expect_equal(MSstatsConvert:::MSstatsMakeAnnotation(
43+
expect_equal(MSstatsConvert:::MSstatsMakeAnnotation(dataset, NULL),
44+
unique_runs)
45+
## No additional information
46+
expect_equal(MSstatsConvert:::MSstatsMakeAnnotation(
4747
dataset, data.table::data.table(Run = 1:5,
4848
Condition = 1,
4949
BioReplicate = 1)),
@@ -52,10 +52,10 @@ tinytest::expect_equal(MSstatsConvert:::MSstatsMakeAnnotation(
5252
BioReplicate = 1))
5353
## Annotation provided - return annotation
5454
annotation_1$Run = as.character(annotation_1$Run)
55-
tinytest::expect_identical(MSstatsConvert:::MSstatsMakeAnnotation(dataset, annotation_1),
56-
annotation_1)
55+
expect_identical(MSstatsConvert:::MSstatsMakeAnnotation(dataset, annotation_1),
56+
annotation_1)
5757
## Column names are updated
58-
tinytest::expect_true(
58+
expect_true(
5959
is.element("Run",
6060
colnames(MSstatsConvert:::MSstatsMakeAnnotation(dataset,
6161
annotation_2,
@@ -65,34 +65,35 @@ tinytest::expect_true(
6565
## MSstats version: no new information in annotation
6666
dataset_chr = dataset
6767
dataset_chr$Run = as.character(dataset_chr$Run)
68-
tinytest::expect_identical(
68+
expect_identical(
6969
MSstatsConvert:::.mergeAnnotation(dataset, NULL),
7070
dataset_chr
7171
)
7272
## MSstats: annotation provided
73-
tinytest::expect_identical(
73+
expect_identical(
7474
MSstatsConvert:::.mergeAnnotation(dataset, annotation_1),
7575
merge(dataset_chr, annotation_1, sort = FALSE)
7676
)
7777
## MSstatsTMT: all is OK
7878
tmt_annotation = MSstatsConvert:::MSstatsMakeAnnotation(dataset_tmt, annotation_3, Run = "Rawfile")
79-
tinytest::expect_identical(
79+
expect_identical(
8080
MSstatsConvert:::.mergeAnnotation(dataset_tmt, tmt_annotation),
8181
merge(dataset_tmt, tmt_annotation, sort = FALSE)
8282
)
8383
## MSstats: missing condition
8484
missing_condition = MSstatsConvert:::MSstatsMakeAnnotation(dataset, annotation_2, Run = "Rawfile")
85-
tinytest::expect_message(MSstatsConvert:::.mergeAnnotation(dataset, missing_condition))
85+
expect_stdout(MSstatsConvert:::.mergeAnnotation(dataset, missing_condition))
8686
## MSstatsTMT: missing channel
8787
missing_channel = MSstatsConvert:::MSstatsMakeAnnotation(dataset_tmt, annotation_4, Run = "Rawfile")
88-
tinytest::expect_error(MSstatsConvert:::.mergeAnnotation(dataset_tmt, missing_channel))
88+
expect_error(MSstatsConvert:::.mergeAnnotation(dataset_tmt, missing_channel))
8989
## Missing column: error
90-
tinytest::expect_error(MSstatsConvert::MSstatsMakeAnnotation(
90+
expect_error(MSstatsConvert::MSstatsMakeAnnotation(
9191
dataset,
9292
annotation2[, .(Rawfile, BioReplicate)],
9393
Run = "Rawfile"))
9494
## Multiple conditions in a Run
95-
tinytest::expect_error(MSstatsConvert::MSstatsMakeAnnotation(
95+
expect_error(MSstatsConvert::MSstatsMakeAnnotation(
9696
dataset,
9797
rbind(annotation_2, data.table::data.table(Rawfile = 1, Condition = 2, BioReplicate = 2)),
9898
Run = "Rawfile"))
99+

inst/tinytest/test_balanced_design.R

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ test1_na[, Intensity := ifelse(feature == "a" & Run %in% c(1, 3, 4) &
2222
IsotopeLabelType == "L",
2323
NA, Intensity)]
2424
test1_nona = filter_NA(test1_na)
25-
tinytest::expect_equal(
25+
expect_equal(
2626
MSstatsConvert:::.makeBalancedDesign(test1_nona, TRUE)[order(ProteinName, feature,
2727
IsotopeLabelType, Run, Fraction), Intensity],
2828
test1_na$Intensity
2929
)
3030
### List of missing values is returned when fill_missing = FALSE
31-
tinytest::expect_message(MSstatsConvert:::.makeBalancedDesign(test1_nona, FALSE))
32-
tinytest::expect_equal(MSstatsConvert:::.getMissingRunsPerFeature(test1_nona)$feature,
33-
"a")
31+
expect_stdout(MSstatsConvert:::.makeBalancedDesign(test1_nona, FALSE))
32+
expect_equal(MSstatsConvert:::.getMissingRunsPerFeature(test1_nona)$feature,
33+
"a")
3434
### All rows in one label are missing
3535
test2_na = data.table::copy(test_data_1)[order(ProteinName, feature,
3636
IsotopeLabelType, Run, Fraction)]
3737
test2_na[, Intensity := ifelse(feature == "a" & IsotopeLabelType == "L",
3838
NA, Intensity)]
3939
test2_nona = filter_NA(test2_na)
40-
tinytest::expect_equal(
40+
expect_equal(
4141
MSstatsConvert:::.makeBalancedDesign(test2_nona, TRUE)[order(ProteinName, feature,
4242
IsotopeLabelType, Run, Fraction), Intensity],
4343
test2_na$Intensity
@@ -56,7 +56,7 @@ test_data_tmt_na = data.table::copy(test_data_tmt)[order(ProteinName, feature,
5656
set.seed(100)
5757
test_data_tmt_na$Intensity[sample(1:nrow(test_data_tmt), 15)] = NA
5858
test_data_tmt_nona = filter_NA(test_data_tmt_na)
59-
tinytest::expect_equal(
59+
expect_equal(
6060
MSstatsConvert:::.makeBalancedDesign(test_data_tmt_nona, TRUE)[order(ProteinName, feature,
6161
Run, Channel), Intensity],
6262
test_data_tmt_na$Intensity
@@ -71,8 +71,8 @@ no_duplicates = data.table::data.table(
7171
Run = 1:6,
7272
Intensity = 1:6
7373
)
74-
tinytest::expect_silent(MSstatsConvert:::.checkDuplicatedMeasurements(no_duplicates))
75-
tinytest::expect_error(MSstatsConvert:::.checkDuplicatedMeasurements(
74+
expect_silent(MSstatsConvert:::.checkDuplicatedMeasurements(no_duplicates))
75+
expect_error(MSstatsConvert:::.checkDuplicatedMeasurements(
7676
rbind(no_duplicates,
7777
no_duplicates[6, ])
7878
))
@@ -85,14 +85,15 @@ no_duplicates4 = data.table::copy(no_duplicates)
8585
no_duplicates4$Intensity[c(1, 6)] = 0
8686
no_duplicates4$isZero = c(TRUE, rep(FALSE, 5))
8787
## Zeros are converted to NA
88-
tinytest::expect_equal(MSstatsConvert:::.fixMissingValues(data.table::copy(no_duplicates2), "zero_to_na"),
89-
no_duplicates3)
88+
expect_equal(MSstatsConvert:::.fixMissingValues(data.table::copy(no_duplicates2), "zero_to_na"),
89+
no_duplicates3)
9090
## NAs are converted to 0
91-
tinytest::expect_equal(MSstatsConvert:::.fixMissingValues(data.table::copy(no_duplicates3), "na_to_zero"),
92-
no_duplicates2)
91+
expect_equal(MSstatsConvert:::.fixMissingValues(data.table::copy(no_duplicates3), "na_to_zero"),
92+
no_duplicates2)
9393
## For Skyline, 0 that are a result of sum(NA, na.rm = T) are replaced by NA
94-
tinytest::expect_equal(MSstatsConvert:::.fixMissingValues(data.table::copy(no_duplicates4))$Intensity,
95-
c(0, 2:5, NA))
94+
expect_equal(MSstatsConvert:::.fixMissingValues(data.table::copy(no_duplicates4))$Intensity,
95+
c(0, 2:5, NA))
9696
## Do nothing if no isZero column and fix_missing = NULL
97-
tinytest::expect_equal(MSstatsConvert:::.fixMissingValues(data.table::copy(no_duplicates3), NULL)$Intensity,
98-
no_duplicates3$Intensity)
97+
expect_equal(MSstatsConvert:::.fixMissingValues(data.table::copy(no_duplicates3), NULL)$Intensity,
98+
no_duplicates3$Intensity)
99+

0 commit comments

Comments
 (0)