@classmethod
def from_string(cls, region_string):
    """
        Convert a string into a :class:`~GenomicRegion`.
        This is a very useful convenience function to quickly
        define a :class:`~GenomicRegion` object from a descriptor
        string.
        :param region_string: A string of the form
                              <chromosome>[:<start>-<end>[:<strand>]]
                              (with square brackets indicating optional
                              parts of the string). If any optional
                              part of the string is omitted, intuitive
                              defaults will be chosen.
        :return: :class:`~GenomicRegion`
        """
    chromosome = None
    start = None
    end = None
    no_space_region_string = ''.join(region_string.split())
    fields = no_space_region_string.split(':')
    if len(fields) > 3:
        raise ValueError(
            'Genomic range string must be of the form <chromosome>[:<start>-<end>:[<strand>]]'
            )
    if len(fields) > 0:
        chromosome = fields[0]
    if len(fields) > 1 and fields[1] != '':
        start_end_bp = fields[1].split('-')
        if len(start_end_bp) > 0:
            try:
                start = int(start_end_bp[0])
            except ValueError:
                raise ValueError('Start of genomic range must be integer')
        if len(start_end_bp) > 1:
            try:
                end = int(start_end_bp[1])
            except ValueError:
                raise ValueError('End of genomic range must be integer')
            if not end > start:
                raise ValueError(
                    'The end coordinate must be bigger than the start.')
    return cls(start=start, end=end, chromosome=chromosome)
