Watch the Melodies Using Subsets online guitar lesson by Matthieu Brandt from Songwriting on Guitar
When you write a melody in a major or minor scale, use all its seven notes and construct it according the principles we discussed earlier (step wise motion with an occasional large jump) the flow of the melody will be smooth. To give a little edge to your melody, you could use a subset from the original major scale or minor scale; the major pentatonic or minor pentatonic. Because there are only 5 notes in that scale, the intervals between the scale notes are sometimes bigger than in the seven note scales. This will make for a rougher sound. We know this from playing minor pentatonic scales over blues progression.
The major pentatonic scale will have a similar effect.