This function returns a Study object given the study number in 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!
    :param studyNum: The Study number (notice it's not zero-based index).
    :type studyNum: int
    :param pathToISATABFile: The path to the ISATAB file
    :type pathToISATABFile: str
    :param noAssays: whetehr to remove all assays (i.e. return a copy of the study only)
    :type noAssays: boolean
    :raise FileNotFoundError: If pathToISATABFile does not contain file 'i_Investigation.txt'.

def getISAStudy(studyNum, pathToISATABFile, noAssays = True):
    """
    This function returns a Study object given the study number in 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!
    :param studyNum: The Study number (notice it's not zero-based index).
    :type studyNum: int
    :param pathToISATABFile: The path to the ISATAB file
    :type pathToISATABFile: str
    :param noAssays: whetehr to remove all assays (i.e. return a copy of the study only)
    :type noAssays: boolean
    :raise FileNotFoundError: If pathToISATABFile does not contain file 'i_Investigation.txt'.
    """
    from isatools import isatab
    import copy
    try:
        isa = isatab.load(pathToISATABFile, skip_load_tables=True)
        st = copy.deepcopy(isa.studies[studyNum - 1])
        if noAssays:
            st.assays = []
        return st
    except FileNotFoundError as err:
        raise err