# How can I combine a kinship matrix with subset individuals when using rvtests?

I've been processing data for a consortium project that uses the rvtests toolkit. Our data analysis process uses a kinship matrix and the calculation of inverse-normalised transformed statistics after covariate adjustment (for 1kG-imputed data from a SNPchip). One of the operations we have been asked to do is to analyse males and females separately for a number of different phenotypes.

Here's an example of the command line that I'm running:

rvtest --inVcf chr${ch}.imputed.poly.vcf.gz \ --pheno ../scripts/phenotypes.raw.2017-May-01.ped \ --pheno-name${traitName} \
--out rv_results/${traitName}_FEMALE_chr${ch} \
--kinship kinship_matrix.kinship \
--meta score,cov[windowSize=500000] \
--peopleIncludeFile ../scripts/female.iids.txt \
--covar ../scripts/covar.2017-May-11.ped \
--covar-name \${covs} --useResidualAsPhenotype --dosage DS


Unfortunately, the kinship matrix doesn't interact well with the --peopleinclude parameter. When I run this, the program complains about unexpected columns in the kinship matrix (starting at one column greater than the number of females in the dataset). I suspect what is happening is that rvtests is assuming that the kinship matrix applies to the sample set after filtering, rather than applying to the total sample set. This sets off a few warning bells in my head, because it means that rvtest is probably ignoring the column/row labels in the kinship matrix that it has generated.

How can I work around this problem?