def dropStudyFromISA(studyNum, pathToISATABFile):
    """
    This function removes a study from an ISA file
    Typically, you should use the exploreISA function to check the contents
    of the ISA file and retrieve the study number you are interested in!
    Warning: this function deletes the given study and all its associated assays
    :param studyNum: The Study number (notice it's 1-based index).
    :type studyNum: int
    :param pathToISATABFile: The path to the ISATAB file
    :type pathToISATABFile: string
    :raise FileNotFoundError: If pathToISATABFile does not contain file 'i_Investigation.txt'.
    """
    from isatools import isatab
    import os
    try:
        isa = isatab.load(pathToISATABFile, skip_load_tables=True)
        studies = isa.studies
        for assay in studies[studyNum - 1].assays:
            if os.path.isfile(os.path.join(pathToISATABFile,assay.filename)):
                os.remove(os.path.join(pathToISATABFile,assay.filename))
        if os.path.isfile(os.path.join(pathToISATABFile,studies[studyNum - 1].filename)):
            os.remove(os.path.join(pathToISATABFile,studies[studyNum - 1].filename))
        del studies[studyNum - 1]
        isatab.dump(isa_obj=isa, output_path=pathToISATABFile)
    except FileNotFoundError as err:
        raise err